MOV AL,1FH ; INT 21H ; POP DS ; DS ;--- MOV AH,2 ; MOV DL,128 ; INT 21H ; MOV DL,129 ; INT 21H ; EGA 11H 10H - . , , - . . AL 0, , . AL 1 2, 8*14 8*8 . AL 3, - , . BL . BL . ES:BP , CX, ( ) DX, - BH, - BL. 10H. : ;--- 128 0 MOV AX,SEG CHARACTER_DATA ;ES:BP MOV ES,AX ; MOV BP,OFFSET CHARACTER_DATA ; MOV CX,128 ; MOV DX,128 ; MOV BL,0 ; MOV BH,8 ; 8*8 MOV AL,1 ; MOV AH,11H ; INT 10H ; 4.3.5 . 8- , . - [4.3.4]. ASCII (16-) 128 78 CC C0 CC 78 18 0C 78 129 00 CC 00 CC CC CC 7E 00 130 1C 00 78 CC FC C0 78 00 131 7E C3 3C 06 3E 66 3F 00 132 CC 00 78 0C 7C CC 7E 00 133 E0 00 78 0C 7C CC 7E 00 134 30 30 78 0C 7C CC 7E 00 135 00 00 78 0C 7C CC 7E 00 136 7E C3 3C 66 7E 60 3C 00 137 CC 00 78 CC FC C0 78 00 138 E0 00 78 CC FC C0 78 00 139 CC 00 70 30 30 30 78 00 140 7C C6 38 18 18 18 3C 00 141 E0 00 70 30 30 30 78 00 142 C6 38 6C C6 FE C6 C6 00 143 30 30 00 78 CC FC CC 00 144 1C 00 FC 60 78 60 FC 00 145 00 00 7F 0C 7F CC 7F 00 146 3E 6C CC FE CC CC CE 00 147 78 CC 00 78 CC CC 78 00 148 00 CC 00 78 CC CC 78 00 149 00 E0 00 78 CC CC 78 00 150 78 CC 00 CC CC CC 7E 00 151 00 E0 00 CC CC CC 7E 00 152 00 CC 00 CC CC 7C 0C F8 153 C3 18 3C 66 66 3C 18 00 154 CC 00 CC CC CC CC 78 00 155 18 18 7E C0 C0 7E 18 18 156 38 6C 64 F0 60 E6 FC 00 157 CC CC 78 FC 30 FC 30 30 158 F8 CC CC FA C6 CF C6 C7 159 0E 1B 18 3C 18 18 D8 70 160 1C 00 78 00 7C CC 7E 00 161 38 00 70 30 30 30 78 00 162 00 1C 00 78 CC CC 78 00 163 00 1C 00 CC CC CC 7E 00 164 00 F8 00 F8 CC CC CC 00 165 FC 00 CC EC FC DC CC 00 166 3C 6C 6C 3E 00 7E 00 00 167 38 6C 6C 38 00 7C 00 00 168 30 00 30 60 C0 CC 78 00 169 00 00 00 FC C0 C0 00 00 170 00 00 00 FC 0C 0C 00 00 171 C3 C6 CC DE 33 66 CC 0F 172 C3 C6 CC DB 37 6F CF 03 173 18 18 00 18 18 18 18 00 174 00 33 66 CC 66 33 00 00 175 00 CC 66 33 66 CC 00 00 176 22 88 22 88 22 88 22 88 177 55 AA 55 AA 55 AA 55 AA 178 DB 77 DB EE DB 77 DB EE 179 18 18 18 18 18 18 18 18 180 18 18 18 18 F8 18 18 18 181 18 18 F8 18 F8 18 18 18 182 36 36 36 36 F6 36 36 36 183 00 00 00 00 FE 36 36 36 184 00 00 F8 18 F8 18 18 18 185 36 36 F6 06 F6 36 36 36 186 36 36 36 36 36 36 36 36 187 00 00 FE 06 F6 36 36 36 188 36 36 F6 06 FE 00 00 00 189 36 36 36 36 FE 00 00 00 190 18 18 F8 18 F8 00 00 00 191 00 00 00 00 F7 18 18 18 192 18 18 18 18 1F 00 00 00 193 18 18 18 18 FF 00 00 00 194 00 00 00 00 FF 18 18 18 195 18 18 18 18 1F 18 18 18 196 00 00 00 00 FF 00 00 00 197 18 18 18 18 FF 18 18 18 198 18 18 1F 18 1F 18 18 18 199 36 36 36 36 37 36 36 36 200 36 36 37 30 3F 00 00 00 201 00 00 3F 30 37 36 36 36 202 36 36 F7 00 FF 00 00 00 203 00 00 FF 00 F7 36 36 36 204 36 36 37 30 37 36 36 36 205 00 00 FF 00 FF 00 00 00 206 36 36 F7 00 F7 36 36 36 207 18 18 FF 00 FF 00 00 00 208 36 36 36 36 FF 00 00 00 209 00 00 FF 00 FF 18 18 18 210 00 00 00 00 FF 36 36 36 211 36 36 36 36 3F 00 00 00 212 18 18 1F 18 1F 00 00 00 213 00 00 1F 18 1F 18 18 18 214 00 00 00 00 3F 36 36 36 215 36 36 36 36 FF 36 36 36 216 18 18 FF 18 FF 18 18 18 217 18 18 18 18 F8 00 00 00 218 00 00 00 00 1F 18 18 18 219 FF FF FF FF FF FF FF FF 220 00 00 00 00 FF FF FF FF 221 F0 F0 F0 F0 F0 F0 F0 F0 222 0F 0F 0F 0F 0F 0F 0F 0F 223 FF FF FF FF 00 00 00 00 224 00 00 76 DC CB DC 76 00 225 00 78 CC F8 CC F8 C0 C0 226 00 CC C0 C0 C0 C0 00 00 227 00 FE 6C 6C 6C 6C 6C 00 228 FC CC 60 30 60 CC FC 00 229 00 00 7E D8 D8 D8 70 00 230 00 66 66 66 66 7C 60 C0 231 00 76 DC 18 18 18 18 00 232 FC 30 78 CC CC 78 30 FC 233 38 6C C6 FE C6 6C 38 00 234 38 6C C6 C6 6C 6C EE 00 235 1C 30 18 7C CC CC 78 00 236 00 00 7E DB DB 7E 00 00 237 06 0C 7E DB DB 7E 60 C0 238 38 60 C0 F8 C0 60 38 00 239 78 CC CC CC CC CC CC 00 240 00 FC 00 FC 00 FC 00 00 241 30 30 FC 30 30 00 FC 00 242 60 30 18 30 60 00 FC 00 243 18 30 60 30 18 00 FC 00 244 0E 1B 1B 18 18 18 18 18 245 18 18 18 18 18 D8 D8 70 246 30 30 00 FC 00 30 30 00 247 00 76 DC 00 76 DC 00 00 248 38 6C 6C 38 00 00 00 00 249 00 00 00 18 18 00 00 00 250 00 00 00 00 18 00 00 00 251 0F 0C 0C 0C EC 6C 3C 1C 252 78 6C 6C 6C 6C 00 00 00 253 70 18 30 60 78 00 00 00 254 00 00 3C 3C 3C 3C 00 00 255 00 00 00 00 00 00 00 00  4. . , PCjr - , EGA - . [4.1.2]. , . EGA -, - , . PCjr. ( ) . 2 , 16 - 4 (8-- , , 8 ). 200 . ( PCjr) 160 - , - (320 ) - - (640 ). , [4.5.3]. - PCjr 16 . . , 16 , . 0 , , 1 - , . 4-6 8-A . , , - ( , ). 16- PCjr 32K , . 4- 0, . - .. 80 . 81- 2. 16- , 160 . 0000 1F3FH, - 2000H 3F3FH. 1F3FH 2000H . PCjr , . PCjr - , 16K, B800H , . , PCjr. EGA DH 10H -. , - , , -- , : , - , 7 . - , . 4 , 16 . . 4-4 . . , BIOS , . - . . BIOS - , . , - , , . 4.4.1 . PCjr EGA -, . , , . . , : 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 10 1010 11 1011 12 1100 13 1101 14 1110 15 1111 . . . 16. - , . : 0 1 0 00 1 01 2 10 3 11 / - , . - , , - , - , , ( ). " " . , , . , - , . , BIOS - , - . 0040:0066H. ; , - , , . . , - , , . - . , . [4.1.3]. EGA PCjr , , . 16- , , . 16 . , , . 16 0100, , , . - 0 . . 4-1 [4.1.3] . - - . , . . , , , . , , (0000) 1110, - , 15 ( - ). 15 0000 ( ), . , 1110, 0000, . , 15 1110. , , , , - . EGA 6 , 4, IBM. 64 , - R'G'B'RGB. R, G B , R', G' B' - . 64 . - , 111111 , 000000 - . - , EGA 64 , , . 4- ( ) 4 , . . , COLOR , . , 0 15, 0 1. , COLOR 2,1 (#2) 1. : 1 - , 2 - 3 - ( - PAINT). SCREEN ,1. , - . PCjr COLOR SCREEN 1. SCREEN 3 SCREEN 6 COLOR ,. - 1 15 16- 1 3 - 4-. 0, - . : PALETTE PALETTE USING. PALETTE - . , PALETTE 9,11 , 9 ( ) 11 ( ). , .. - 0 0, 12 - 12 .. PALETTE. , SCREEN 4 SCREEN 6 , 1-3 , 1 . . 16 - PALETTE USING. PALETTE USING 16-- . - . 0 15, -1, . , - , ARRAYNAME(0) = 15, ARRAYNAME(1) = 14 .. PALETTE USING ARRAYNAME(0) - ARRAYNAME . 0 , - . , , 16 . PALETTE USING ARRAY- NAME(12) , 12- . - , PALETTE USING , . : 100 DEF INT A-Z ' 110 DIM SCHEME1(16) ' #1 120 DIM SCHEME2(16) ' #2 130 DATA 3,5,9,2,4,12,15,1,6,7,14,13,8,11,10,0 140 DATA 0,11,13,7,1,12,2,5,10,8,14,6,15,4,9,3 150 FOR N = 0 TO 15 ' 160 READ Q ' 170 SCHEME1(N) = Q ' 180 NEXT ' 190 FOR N = 0 TO 15 ' 200 READ Q ' 210 SCHEME2(N) = Q ' 220 NEXT ' 230 PALETTE USING SCHEME1(0) ' . 500 PALETTE USING SCHEME2(0) ' . BH 10H , - . BH 0, 0 15 BL. BH 1, BL 0 1. - 0: ;--- MOV AH,0BH ; MOV BH,0 ; MOV BL,3 ; INT 10H ; MOV BH,1 ; MOV BL,1 ; 1 INT 10H ; PCjr 4- , 1-3 , . 2- 0 BL , 1, 1 - . - , 16- . BH 0, BL - . . " " 3D9H. -, ( [4.1.3]). 0-3 (- , ). 5 , 0, 0. . , , . MOV DX,3D9H ; MOV AL,00100110B ; 1 OUT DX,AL ; , PCjr EGA. . PCjr 10H 1FH. 3DAH. . , . , . , (1001) 2: ;--- 2 MOV DX,3DAH ; IN AL,DX ; MOV AL,12H ; OUT DX,AL ; MOV AL,00001001B ; OUT DX,AL ; EGA - 3C0H, 00 0FH. 3DAH ( 3C0H), , . EGA , 6- . 4.4.2 (, PCjr). . , , , . - , , . , 4 8 . , - . . PSET PRESET . PointSET (- ) PointRESET ( ). . , , . , x,y - .. , ; LOCATE, - . PSET(50,80) PRESET(50,80) - 50 80. PSET , , - . , - , . PRESET . ( 0). : 100 PSET(100,180),3 ' 3 110 PRESET(100,180) ' PSET PRESET , 0,0. WINDOW , , -100,100, - 0,0, - 100,-100. WINDOW(-100,100)-(100,-100). ( 25*80 ( 25*40), LOCATE - [4.2.1].) LINE [4.4.5], ( x). - , , . ( ). , WINDOW(100,-100)-(-100,100), -100 . . , , , . ( ) y - . , . SCREEN, , WINDOW SCREEN(-100,100)-(100,-100). , . , , . , , WIN- DOW . , , . PMAP "" , WINDOW. PMAP : 0 x "" 1 y "" 2 x "" 3 y "" PMAP(,). , , "" WINDOW. (-100,100), - (100,-100). - (0,0) 320*200, 0,0? X X = PMAP(0,0), Y - Y = PMAP(0,1). X = 160, Y = 100. . CH 10H . DX , CX - , 0. - AL. , AX - . , AX . ;--- 100,180 MOV AH,0CH ; MOV AL,3 ; 3 MOV CX,100 ; MOV DX,180 ; INT 10H ; ;--- MOV AH,0CH ; MOV AL,0 ; MOV DX,100 ; MOV CX,180 ; INT 10H ; AL, . 1, . - , . 1 0, 0. , . , . - 16-- , , . , 4- 1 ( 01B) 2 (10B). , 11B? 01B 10B, 10B 01B - . . - ( ). - () () , , . - . , - PCjr, 16- , 32K, , B800H . , - 2000H. - . - CX, - DX. 0 CX 0, . 0 . , 2000H - . 2, 80, .. 80 . - SHL, , , . , , , . ( ) . , , , . 2 , . , - , . 4, - 8. : , / . . , . , . . OR . . ;--- PALETTE_COLOR DB 2 ;--- MOV AX,0B800H ; MOV ES,AX ; MOV CX,100 ; MOV DX,180 ; CALL SET_DOT ; . . ;--- SET_DOT PROC TEST CL,1 ; ? JZ EVEN_ROW ; , MOV BX,2000H ; JMP SHORT CONTINUE ; EVEN_ROW: MOV BX,0 ; CONTINUE: SHR CX,1 ; 2 MOV AL,80 ; 80 MUL CL ; AX - ;--- MOV CX,DX ; NOT CL ; AND CL,00000011B ; CL - (0-3) SHL CL,1 ; ;--- SHR DX,1 ; 4 SHR DX,1 ;( ) ;--- ADD AX,DX ; ADD BX,AX ; ;--- MOV AH,ES:[BX] ; ROR AH,CL ; AND AH,11111100B ; 2 MOV AL,PALETTE_COLOR ; OR AH,AL ; ROL AH,CL ; MOV ES:[BX],AH ; RET ; SET_DOT ENDP 4.4.3 (EGA). EGA . 0-7 , - PCjr, DH 10H . , , . . 4-4 [4.4.0]. D, E 10H 4 . , -- , - [4.4.2]: , , , 7 . , - . , - ( 16 ), - . 4 , - ? , . - 4 , . - , , - . (latch register). - , . (, - , - , .) , , . , - . - . , , . - , , . - ,