, , . , . , STRIG , . STRIG . -, , , X = STRIG(n). n - : 0 A1 1 A1 2 B1 3 B1 4 A2 5 A2 6 B2 7 B2 -1, 0 - . STRIG , . ON STRIG(n) GOSUB . - . n , 0 = A1, 2 = B1, 4 = A2 6 = B2. . STRIG STRIG(n) ON. n - . ( ) - STRIG(n) OFF. . STRING(n) STOP , , STRING(n) ON. - - ON STRING GOSUB. , STRIG(n) STOP . ON STRIG GOSUB. [7.3.3] , X = STRIG. 100 ON STRIG(0) GOSUB 5000 ' 5000 . ' A1 200 STRIG(0) ON ' . 300 STRIG(0) STOP ' . 400 STRIG(0) ON ' . 500 STRIG(0) OFF ' . 5000 ''' A1 . 5500 RETURN ' , . AT - . 84H 15H 4-7 AL, . DX 0; DX 1, - [7.3.3]. - , . ;--- #2 B ( 7) MOV AH,84H ; MOV DX,0 ; INT 15H ; JC NO_JOYSTICK ; , TEST AL,10000000B ; 7 JNZ BUTTON_DOWN ; . 7-4 201H , - . , : 7 #2 B D 6 #1 B C 5 #2 A B 4 #1 A A : MOV DX,201H ; IN AL,DX ; TEST AL,0010B ; 1 ( A2 ?) JNZ BUTTON_A2 ; , , , , . , - , , [2.1.7]. - 18.2 - . . . . . , "" (= 1) "" (= 0), 256 . , 256 - ( ASCII) 0 255. , - - , , . , , 0 255, , - 00000000 11111111 - 00 FF. , . B, - H, , 11111111B FFH. Microsoft &H, &FFH; , . : , 8 . , 0 7. - , . , 10 , . , , - , - .., 128 . , 1, 1 , 0, 1 , 9 + 1 = 0 . : 00000000 0 00000001 1 00000010 2 00000011 3 00000100 4 00000101 5 00000110 6 00000111 7 00001000 8 00001001 9 00001010 10 - , .. 0, 1, 10, 11, 100, 101 .. , - , , . , , : 7 6 5 4 3 2 1 0 128 64 32 16 8 4 2 1 10000001, 7 0. 7 128, 0 - 1, 129. , ASCII 129, u ( - ). , A, ASCII . . . - 11000000 11 , 192. - , . - . (OR) (AND) - 0 255. , - - , , . , , 0 255, , - 00000000 11111111 - 00 FF. , . B, - H, , 11111111B FFH. Microsoft &H, &FFH; , . : , 8 . , 0 7. - , . , 10 , . , , - , - .., 128 . , 1, 1 , 0, 1 , 9 + 1 = 0 . : 00000000 0 00000001 1 00000010 2 00000011 3 00000100 4 00000101 5 00000110 6 00000111 7 00001000 8 00001001 9 00001010 10 - , .. 0, 1, 10, 11, 100, 101 .. , - , , . , , : 7 6 5 4 3 2 1 0 128 64 32 16 8 4 2 1 10000001, 7 0. 7 128, 0 - 1, 129. , ASCII 129, u ( - ). , A, ASCII . "", 256 ASCII 1. . 16H, 256 . 2 , , .. "", ASCII 1. 2 - 15H. , . ES:BX , , CX - , - . DX , ES:BX 1. 0, , AH 1, , 2 - 3 - . 3 15H . ES:BX , CX , . ES:BX , . 0 () 1 () 15H. . 7.3.2 . , , , . . , , . , - , . . - . . , , - , . PEN X = PEN(n), n - , - . - n : 0 -1, - , 0 - 1 x (0-319 0-639), - ( , ) 2 y (0-199), . 3 -1, 0 - 4 x (0-319 0-639) 5 y (0-199) 6 - (1-24), 7 - (1-40 1-80), - 8 - (1-24) 9 - (1-40 1-80) , , : 100 IF NOT PEN(3) THEN 130 ' 110 X = PEN(4) ' x 120 Y = PEN(5) ' y 130 ... ' - ON PEN GOSUB. , , - . . - . - , , . ON PEN GOSUB , - PEN ON. PEN OFF . , , . , ON PEN GOSUB, PEN STOP. , , . PEN ON, - ON PEN GOSUB. , - . , ERROR ; INC BX ; LOOP NEXT_CHAR ; MS DOS - 5 21H. DL . LPT1 - . ;--- LPT1 MOV AH,5 ; MOV DL,CHAR ; INT 21H ; ;N,1)*2^(N-1) 2040 NEXT 2050 RETURN . . , , , . - , , . , , , , - . , , , 95 % , , , - - . 8088 13 16- , . , - , , , - . , - , , - .. - ; , - . . -1 13 8088 80286 ( - , ). AX, BX, CX DX - . , - , . - , , AH AX, AL - . BH, BL, CH, CL, DH DL. , - . BP, SI DI , 16- . , , , . - MOV. MOV AX,BX BX AX, AX . MOV AH,BL , MOV AX,BL - - , . MOV , - , MOV AX,ACCT_NUMBER. ACCT_NUMBER - , , . ACCT_NUMBER DW 0. - ( ), 0. DD - DB - . , MOV AX,ACCT_NUMBER . - - . , . , MOV AX,[BX][SI] AX , , BX SI. - ? , , - . , , , - - . , , . , , - DS, . 16-, , 65535. , ? , 16, , . , 16- . , - , 65535 . (ES) - , . , - , - . MOV AX,SEG ACCT_NUMBER - , ACCT_NUMBER AX, DS. MOV BX,OFF- SET ACCT_NUMBER BX ACCT_NUMBER . DS:BX - ACCT_NUMBER. ACCT_NUMBER - , . LEA, . - , . , MOV , . IP ( ) , , - . IP - , . , . , , (), . , , , RETURN , , . , - , COMBINE_DATA, CALL COMBINE_DATA - . RET (- ). , . , . - . - , , , . SS. SP , - . , . -, , , - , , -, . , . , - , , . - PUSH, POP. , - , PUSH BX POP DX. - . - (CS, DS SS) - , . : ADD AX,BX BX AX. - (SUB), . MUL BL BL AX. (DIV), . INC BL BL 1. - (DEC). LOOP XXX XXX, , CX ( FOR .. TO .. NEXT - ). OR AL,BL AL BL, AL. AND, XOR NOT. SHL AX,1 , AX, . AX 2. - . , . IN AL,DX AX , , - DX. OUT. JMP , GOTO . JMP YYY - , YYY. CMP AL,BL AL BL. CMP . - , CMP JGE, BL AL. CMP , IF .. THEN ( IF .. THEN CMP). TEST AL,BL , BL, , AL. - , CMP. TEST - ( ). MOVS , CX, , SI, , DI. - , . , . , , - . , - - . - "". , , , (, , ) . - . , . , CALL, INT. INT21H 21. , / , , - . , - . . , . - , , . ( Lattice C Turbo Pascal) , . . , , , , .. . " BX ...", - . , . " AX ...". . , - 21H. . ( BIOS DOS) AH ( AL ). . - , , - . . , - . . - , , , - ( ). C, - , , . - . ! , . . . - . , - , , , . , . , , . - , - . , , , , . DATA - , - CALL. , - - . , , . 64K, , , 256K, 64K. 128K , . , 25K 64K, . 64K CLEAR, . CLEAR,n n . - . , , DEF SEG, READ , . : 100 DATA &Hxx, &Hxx, &Hxx, &Hxx, &Hxx '10- 110 DATA &Hxx, &Hxx, &Hxx, &Hxx, &Hxx . . 300 ''' 310 DEF SEG = &H3000 ' 320 FOR N = 0 TO 9 ' 10 330 READ Q ' 340 POKE N,Q ' 350 NEXT , DEF SEG - . - 0 CALL . , CALL. : 500 DEF SEG = &H3000 ' 510 DOGS = 12 ' 3 520 CATS = 44 ' 530 POSSUMS = 1 ' 540 CASUALTIES = 0 ' 1- 550 CALL CASUALTIES(DOGS,CATS,POSSUMS) ' , . . CHR$. VARPTR . - , , - VARPTR ( ). . , DEF SEG, , - CALL. : 100 DEF SEG ' 110 X$ = "CHR$(B4)+..." ' 120 Y = VARPTR(X$) ' 130 Z = PEEK(Y+1)+PEEK(Y+2)*256 ' 140 CALL Z , CHR$() ASCII. ROUT = CHR$(12) + "AB" ROUT = CHR$(12) + CHR$(65) + CHR$(66). - ASCII Alt, , - Alt. 0 31 . . ANSI.SYS. ANSI.SYS , - , , MS DOS. COMMAND.COM , . , - ANSI.SYS, - , IBM- , MS DOS. - , - , ( ). ANSI.SYS - . ANSI.SYS - . 2.0 CONFIG.SYS, AUTOEXEC.BAT. CONFIG.SYS , . , COMMAND.COM. ANSI.SYS . DEVICE = ANSI.SYS. - . - COPY. : COPY CON: CONFIG.SYS <CR> DEVICE = ANSI.SYS <CR> <F6> <CR> F6 Ctrl-Z (ASCII 26), - . . 8088. , - : () [BX],[BP],[DI],[SI] 5 () 6 () + [BX][SI], [BX][DI] 7 [BP][SI], [BP][DI] 8 () + [BX],[BP],[DI],[SI] + . 9 () + + [BX][SI],[BX][DI] + . 11 [BP][SI],[BP][DI] + . 12 2 . : AAA 4 1 AAD 60 2 AAM 83 1 AAS 4 1 ADC , 3 2 ADC , 9(13) + EA 2-4 ADC , 16(24) + EA 2-4 ADC , 4 3-4 ADC , 17(25) + EA 3-6 ADC , 4 2-3 ADD , 3 2 ADD , 9(13) + EA 2-4 ADD , 16(24) + EA 2-4 ADD , 4 3-4 ADD , 17(25) + EA 3-6 ADD , 4 2-3 AND , 3 2 AND , 9(13) + EA 2-4 AND , 16(24) + EA 2-4 AND , 4 3-4 AND , 17(25) + EA 3-6 AND , 4