. 3, - 2. , , 2 (SHL ), . ( -1). , DB , 256, DW . CMP CMPSW , . , , . . . . , . ------------------------------------------------------------ IBM PC. 14 34 14.1. , , . 14.2 , 1, , 14.1. . 14.3 , : ) : 06, 10, 14, 21, 24; ) : , , , , ; ) : 93.95, 82.25, 90.67, 85.80, 13.85. 14.4 , (ITEMIN) (QTYIN) . 14.3, ITEMIN. . ( ) . 14.5 14.3, : ) () ; ) . IBM PC. 15 45  15. I:  ------------------------------------------------------------ I: : () , . ------------------------------------------------------------ . () (), , . . c 5 1/4 40 , 00 39. 512 . , , . , , - , , . . . o . , , , , . : +--+---+-----++--+---+-----++--+---+-----+ +--+---+-----+ |1||||2||||3|||...|n||| +--+---+-----++--+---+-----++--+---+-----+ +--+---+-----+ . , 5 1/4" . ------------------------------------------------------------ : IBM PC. 15 46 DOS 2.0 40 8 512 327 680 DOS 2.0 40 9 512 368 640 80 15 512 1 228 800 3 1/2" 80 9 512 737 280 : 4- 10 306 17 512 10 653 696 20 614 17 512 21.377.024 (), . 0, - 1. () ------------------------------------------------------------ , , DOS . . : 0 0 1 0 0 2-3 (FAT) 0 0 4-7 1 0 1-3 1 0 4 ... 1- 0- . 0- 1- p, 1- 1- , 0- 2- .. . , . FORMAT /S , DOS IBMBIO.COM IBMDOS.COM . IBM PC. 15 47 , 512 ( 512), . DOS p . , , . : 0-7 , , . : .00 , , .E5 - , . 2E - . 8-10 11 , : .00 - ; .01 - ; .02 - "" ; .04 - DOS; .08 - ; .10 - ; .20 - ( ). 12-21 DOS. 22-23 , , : || 24-25 , : ||| 1980 0 119, - 1 12, - 1 31. 26-27 . . ( COM- DOS) 002. , . 28-31 . DOS . , , . ------------------------------------------------------------ (FAT - File Allocation Table) - . , DOS IBM PC. 15 48 . 1, 2 FAT. FAT , FAT . , - . FAT p , . FAT : FE 8 FC 9 FF 8 FD 9 F9 (1,2 ) F8 FFFF. ( ). "" : FAT .. , 8 1 2-3 4-7 1 , 9 1 2-5 6-9 1 , 8 1 2-3 4-10 2 , 9 1 2-5 6-12 2 (1,2 ) 1 2-15 16-29 1 XT 1 2-17 18-49 8 AT 1 2-838 4-115 4 , FAT . 12 . ( DOS 3 FAT 16 ). FAT, 000 001, , , . 002. FAT . (12 ), : 000 , nnn , FF7 ( ), FFF . , , PAYROLL.ASM, 002, 003 004. IBM PC. 15 49 PAYROLL, - ASM, .00 , , 002 - . FAT ( , ): FAT: |FDF|FFF|003|004|FFF|000|000|...|000| .: 0 1 2 3 4 5 6 ... FAT 000 001. , : 1. DOS PAYROLL ASM. 2. DOS (002) . 3. DOS FAT, 002. , , , 003. , 003. DOS . 4. DOS FAT, 003. 004, 004. DOS . 5. FAT 004 .FFF, , . , FAT - . , , . , , , , FAT .FFF , . , , 15. FAT : 15 1,5, 22,5. 22 23 FAT. , F*FF. : FFF*. IBM PC. 15 50 15-, - FFF . , , 15. FAT, 22 , p p: 6* 01 17 80 01 FF*F , FAT, 15 1,5, 22,5, 22 23, . 6*01, 016*. 15- , 016. , , 016. , , 16 1,5 24. 24 25 FAT. 1780 8017. 16 , 017. 017. , , 17 1,5, 25.5. 25 26 FAT. 8001 0180. 17 , 018. 018. FAT 27 28, FF*F, *FFF. 18 , FFF, . , p. , , . , FAT , , , DOS 1BH 1CH. ------------------------------------------------------------ . () , , , , , p . IBM PC. 15 51 (FAT) p . ------------------------------------------------------------ 15.1. ? 15.2. ? 15.3. ? 15.4. DOS FORMAT /S? 15.5. FAT, ? 15.6. 2890 () : ) c ? ) ? ) , . IBM PC. 16. 1  16. II: DOS ------------------------------------------------------------ II: DOS : DOS . ------------------------------------------------------------ DOS, (FCB), . DOS . DOS (FCB - file control block), . FCB DOS -. . . , "" DOS . , "" , , DOS . , "" , . , , . , , "" "" , DOS 21H. , , DOS, 25H 26H. BIOS 13H, . DOS BIOS. 17 DOS 2, 18 BIOS. : . (FCB) ------------------------------------------------------------ - DOS FCB. FCB , IBM PC. 16. 2 . FCB . 0-15 32-36, 16-31 DOS. 0 : 01 A, 02 B .. 1-8 , , 8 . , , LPT1 . 9-11 , , DTA ASM. , . DOS . 12-13 . 128 . ( 32). 0, - 1 .. 0. 14-15 . 128 (.80). . 16-19 . DOS ( ) . . , . 20-21 . DOS . . 22-31 DOS. 32 . (-127) (. 12-13). . - 0, 0 127. 33-36 . . , 25 (.19), 19000000. , IBM PC. 16. 3 . (1.073.741.824 ), . 64, 36 00. , . FCB , . .FF, - , .. FCB ------------------------------------------------------------ . - FCB DX. FCB DS:DX. .16 DOS INT 21H : MOV AH,16H ; LEA DX,FCBname ; INT 21H ; DOS DOS , FCB, . , ( ), , DOS , , DOS . 0 "" . , AL: 00 FF . FCB - 0 ( ) - 128 (.80) . , , . (DTA - disk trausfer area). FCB , DTA . .1A IBM PC. 16. 4 DOS DTA. DTA. DTA: MOV AH,1AH ; LEA DX,DTAname ; DTA INT 21H ; DOS , DTA . DTA . . 15: MOV AH,15 ; LEA DX,FCBname ; INT 21H ; DOS FCB DTA. , . . , 128 , (4*128=512) . DOS FCB 1. 128, 0 FCB 1. AL : 00 . 01 . 02 DTA . , , , (.1A). .10: MOV AH,10H ; LEA DX,FCBname ; INT 21H ; DOS , DOS , . AL : 00 . FF IBM PC. 16. 5 ( ). : FCB ------------------------------------------------------------ , .16.1, , . FCB (FCBREC) : FCBDRIV 4 ( D). FCBNAME - NAMEFILE. FCBEXT - DAT. FCBBLK - 0. FCBRCSZ , 128. FCBSQRC - 0. : BEGIN , C10OPEN DTA DOS, D10PROC . , G10PROC . C10OPEN , - 32 (.20) DTA DOS. D10PROC , F10WRIT . E10DISP . F10WRIT . G10CLSE . X10ERR . 1 FCBSGRC ( ) .20 ( ) FCBFLSZ ( ). 32 , 16 . DTA : DTA: | | : | 00| 01| 02|...| 15| 25 , 1 25 (.19). : 25 * 32 = 800 . 320 IBM PC. 16. 6 ------------------------------------------------------------ ------------------------------------------------------------ . 16.1. . . : 20030000. : : | 16| 17|...| 24|.1A|...|...| , . , , DTA. , (EOF), . 1A. , , , . , , FCB. ------------------------------------------------------------ DOS , , , , . . OF: MOV AH,OFH ; LEA DX,FCBname ; INT 21H ; DOS , FCB. , AL . FF. , AL 00 FCB , 0, .80. . DTA , . DTA .1A ( EOF .1A) : MOV AH,1AH ; LEA DX,DTAname ; DTA INT 21H ; DOS IBM PC. 16. 7 .14: MOV AH,14H ; LEA DX,FCBname ; INT 21H ; DOS DTA FCB. AL : 00 . 01 , . 02 DTA . 03 , , . DOS. FCB DTA. ( ) . . FCB 1. (EOF), . , . , . , DOS . : FCB ------------------------------------------------------------ .16.2 , , , . FCB, , FCB . . : BEGIN , E10OPEN DTA F10READ . , , , G10DISP. E10OPEN , , 32 (.20), DTA. IBM PC. 16. 8 F10READ . FCB. G10DISP . X10ERR . ------------------------------------------------------------ ------------------------------------------------------------ . 16.2. . , FCB , . 00 (16 ) . DTA, FCB 00 01: : | 00| 01| 02|... | 15| DTA : | 00| . , 01 DTA . 16 . 16- DTA. DTA. AL . 01. ------------------------------------------------------------ , , . , , ( DTA, FCB). A B. , . , , . , , 300- , IBM PC. 16. 9 299 , 300- . : ). , , (). , DOS, FCB . ( 33-36) FCB. . ( 12-13) ( 32). DTA , . , . 05 FCB . DTA. FCB .21: MOV AH,21H ; LEA DX,FCBname ; INT 21H ; DOS . , DTA AL : 00 01 02 - DTA 03 , . , .