ASCII 0. AL , 0 , 1 - , 2 - /. AX - 16- , - . . 1 - , : . - , . 0, . - , AX 2 - , 4 - , 6 - 12 - AL. - : ;--- PATH DB 'A:LEVEL1\FILENAME.EXT',0 ;--- / MOV AH,3DH ; MOV AL,2 ; / LEA DX,PATH ;DS:DX INT 21H ; JC OPEN_ERROR ; MOV HANDLE,AX ; 3EH 21H , . BX - . 0, , 1, AX = 6, . ;--- MOV AH,3EH ; MOV BX,HANDLE ; INT 21H ; JC CLOSE_ERROR ; 45H 21H . BX , AX . 46H 21H ( CX) ( BX) , , . 5.3.4 ; . 11- . , . , . . NAME. . , , - , NAME "OLDFILE.EXT" AS "NEWFILE.EXT". . , , . , NAME "B:LEVEL1\OLDFILE.EXT" AS "B:LEVEL1\NEWFILE.EXT" LE- VEL1. , . NAME "B:LEVEL1\OLDFILE.EXT" AS "NEWFI- LE.EXT", , . NAME "A:SUBDIR1- \OLDFILE.EXT" AS "A:SUBDIR2\OLDFILE.EXT". . , , . 58 [5.4.8]. . MS DOS , - , . , - . FCB: 17H 21H. DS:DX . FCB, 11H ( "" ). "?", , , . , , AL FF, AL = 0. ACCOUNTS.DAT DEBTS.DAT. ;--- FCB DB 'FILENAMEEXT',25 DUP(0) NEWNAME DB 'NEWNAME EXT', ;11 ;--- NEWNAME MOV SI,OFFSET NEWNAME ;DS:SI MOV AX,SEG FCB ;ES:DI FCB MOV ES,AX ; MOV DI,OFFSET FCB ; ADD DI,11H ; 11H MOV CX,11 ; 11 REP MOVSB ; 11 LEA DX,FCB ;DS:DX FCB MOV AH,17H ; INT 21H ; CMP AL,0FFH ; JE RENAME_ERROR ; : 56H 21H . DS:DX , - ( 63- ) ASCII 0. ES:DI , . , , . , . - , . , , , AX 3 - , 5 - 17 - . ACCOUNTS.DAT GAINS LOSSES. ;--- OLDPATH DB 'A:GAINS\ACCOUNTS.DAT',0 NEWPATH DB 'A:LOSSES\ACCOUNTS.DAT',0 ;--- LEA DX,OLDPATH ;DS:DX MOV AX,SEG NEWPATH ;ES:DI MOV ES,AX ; MOV DI,OFFSET NEWPATH ; MOV AH,56H ; INT 21H ; JC ERROR_ROUTINE ; 5.3.5 . , , - . - . , . - , . MS DOS / . . : , , - , . FCB , , ; MS DOS - , . , FCB FCB, . FCB: (DB) , , 1 = A, 2 = B .. 0, , 0 . , (11 ) (ASCII 32), 8 . . . (DW) DOS 128 , 0 127. , - #129 , #0 #1 ( , 0). . , - FCB. (DW) MS DOS, , . , , . - , - . 512 , 512 . - 80H (128) - . . (DD) . - . (DW) FCB. [5.2.5]. (DB) . 0 127. #200, - 1, 71 ((200 - 128) - 1). - , , (DD) , MS DOS . 4- . MS DOS - . , . , . 5-3. FCB . , . - ASCII 0. FCB ( 0FH 21H, [5.3.3]) . , FCB 128 . FCB , DS:DX . - : FCB DB 1,'FILENAMEEXT',25 DUP(0) FCB : FCB STRUC DRIVE_NUM DB 0 FILE_NAME DB 8 DUP(?) FILE_EXT DB 3 DUP(?) BLOCK_NUM DW 0 RECORD_SIZE DW 0 FILE_SIZE DD 0 FILE_DATE DW 0 RESERVED DB 10 DUP(0) CURRENT_REC DB 0 RANDOM_REC DD 0 FCB ENDS FCB, - . - : 1. . 2. , , - 0 ( FCB, ). 128, - , . 3. ( ). [1.3.0] , . , - , .COM. FCB 5CH . COM ORG FCB ( DTA, - ): ;--- ORG 5CH FCB LABEL BYTE DRIVE_NUM DB 0 FILE_NAME DB 8 DUP(?) FILE_EXT DB 3 DUP(?) BLOCK_NUM DW 0 RECORD_SIZE DW 0 FILE_SIZE DD 0 FILE_DATE DW 0 RESERVED DB 10 DUP(0) CURRENT_REC DB 0 RANDOM_REC DD 0 ORG 80H DTA LABEL BYTE ORG 100H ASSUME CS:CSEG, DS:DSEG, SS:SSEG ... FCB , , , . [5.2.6]. FCB 7 , 7 - . FF, . 5 ASCII 0, . FCB DS:DX , , FCB. , 2 - , 1 - : FCB DB 0FFH, 5 DUP(0),2,1,'FILENAMEEXT',25 DUP(0) : FCB. , , DOS. B:COMPILE\UTILITY\PASCAL PASCAL UTILITY. 63 , . ( 3DH 21H - . [5.3.3]), DS:DX . - , 16- AX. . : , - . , . - , - . , . , - , [1.3.1]. , , 10000 10000 , . FCB DTA. , . DTA DTA. , - DTA, , - . DTA DOS / - . , . DTA , - , DTA, - . - DTA . - , , . DTA (64K). DTA 1AH - 21H. DS:DX DTA, . . : ;--- DTA 256 DUP (?) ;--- DTA LEA DX,DTA ;DS:DX DTA MOV AH,1AH ; DTA INT 21H ; DTA 2FH 21H - DTA. . ES:BX DTA. [1.3.0] 128- DTA, 80H 9FH. . - DTA , , - . COM , DS . EXE , DTA . , - DTA 2FH 21H. , ES:BX DTA. DTA . - , . , , . 5.3.6 . , , . - 128- , 80H [1.3.0]. ( - DTA , [5.3.5].) , . , , , , . , - MS DOS . - , , 'A:ACCT.- BAK' 1,'ACCT BAK'. MS DOS , , - . (par- sing). . , . - : . ; , = + - . : . ; , = + \ < > | / " [ ] , - ( ASCII 1 31). 29H 21H . DS:SI 81H PSP. , DS, ES PSP. ES:DI , . AL - . 0-3: 0 1 = 1 1 = , , FCB, 2 1 = FCB 3 1 = FCB - , - . , . , , (ASCII 32). , FCB. AL 1, * ? FF, - . DS:SI , , 81H. , - . ES:DI FCB. FCB , ES:[DI]+1 . , FCB PSP, 5CH: ;--- , FCB 5CH ;--- PSP MOV AH,29H ; MOV SI,81H ; MOV DI,5CH ; MOV AL,1111B ; INT 21H ; MOV AL,ES:[DI]+1 ; CMP AL,32 ; JE ERROR_ROUTINE ;  4. . - . - "" " ", : - . - , , - . . - , - , , . - , , - , (ASCII 13), (ASCII 10). , , , . , . . - , . "128" , - - , - . - . , / , , . , 10 20- . , , - , ( , - , ). , . , - / . . . . - , . 10 , - 50- , - 491- (.. #490, 0). - . , , . , , . 2, 3 5 . 10 . . - , / , - . 74, 73 ( 73 , , ). - . , . , ( ). - , MS DOS . . . n- , , - . - , . , . - ; - . , - . / . , . , COMMAND.COM. , , [5.1.1] - [5.2.1] - . 5.4.1 765 8237. 765 NEC , . , - , . , , - . , DOS BIOS , , , , - . . ROM-BIOS, MS DOS, - , , . , , - ROM-BIOS . 8272A Intel, NEC. - , , - IBM PC . 8272A (Microsystem Components Handbook). 15 , : . , , . [5.2.1], [5.1.1] . 6 : 1. , . 2. , . 3. DMA . 4. , , . 5. . 6. . /. , , . : 3F2H 3F4H 3F5H . : 1-0 , 00 = A 01 = B 10 = C 11 = D 2 0 = 3 1 = FDC DMA 7-4 1 = D-A ( 4 = A) , . A, 00011100. - A, 2, A. - 2 , - , , . "" . . - , - . , 2 , , , , . , - . , - . , . , . - . , , . : , . . - . . , , . - , - . . - IBM PC 15 . , . 5- . - (0-3) (0 1) 2, . - , - . , . , . , , - . , 0 128, 1 256, 2 512 3 1024. , MS DOS 512 . (EOT), ; - 9 360K. , (GPL, 2AH) (DTL, FFH). IBM PC , , , - . MS DOS - , , (disk base). 1EH - . , , 3. - , . X , - , H - , DD - - . # 0 15, 1 1 00001111 1FH 2 00H XXXXXHDD 1 01100110 66H 2 00H XXXXXHDD 3 0FH 4 00H 5 01H 6 02H 7 09H 8 1AH 9 FFH 1 01000101 45H 2-9 , , . 7 6 . : 3-0 1 = D-A 4 1 = / 5 1 = DMA 6 1 = 0 = 7 1 = , 6 , . , . , 7 ; , 1, . , - . , . , 6, . , . - , BIOS 7 BIOS, 0040:003E. . , 7 , . - 8237. , , . , PCjr, DMA, - , . , , . , PCjr . - , , 1 8253 , . IBM PC - DMA, . IBM PC XT 4- DMA 8237. 0 "" (memory refresh); - . , . 2 ,