- , . ASCII 0 - . "CURRENT_DIR": ;--- CURRENT_DIR DB 64 DUP(?) ;--- MOV AH,47H ; LEA SI,CURRENT_DIR ; MOV DL,1 ; A INT 21H ; DS:SI 5.2.5 / . , 22-23 32- . 24-25 - . : : 11-15 (0-23) 5-10 (0-59) 0-4 (0-29 2- ) : 9-15 (0-119, 1980 ) 5-8 (1-12) 0-4 (1-31) ; DOS - . , , 2- , . . , . FCB 0FH 21H, . FCB 14H [5.3.5]. , , . 57H 21H - . BX, 0 AL. AL 1. DX, CX. - , . MS DOS , CH DH, . . , AX 1, AL 6, - . , : ;--- PATH DB 'B:NEWDATA.BAK',0 ;--- LEA DX,PATH ; MOV AH,3DH ; MOV AL,0 ; INT 21H ; JC OPEN_ERROR ; ;--- MOV BX,AX ; BX MOV AL,0 ; MOV AH,57H ; INT 21H ; JC TIME_ERROR ; ;--- , , CH MOV CL,3 ; SHR CH,CL ; CH 5.2.6 . DOS , . ( ). 12- 32- . , . : 5 = 1, 4 = 1, 3 = 1, , 2 = 1, "" 1 = 1, 0 = 1, 5 , BACKUP RESTORE DOS. 0 , . - . . . [5.2.1], , , . , - 11, 43, 75 .. , , , . . , - . "NEWDATA.AAA". 100 ' , &H2000 ... 110 DEF SEG = &H2000 ' 120 FILENAME$ = "NEWDATAAAA" ' 130 DIRPTR = 0 ' 140 FOR N = 1 TO 112 ' 150 X$ = "" ' 160 FOR M = 0 TO 10 ' 170 X$ = X$+PEEK(DIRPTR+M) ' 180 NEXT ' 190 IF X$ = FILENAME$ THEN 220 ' , 200 NEXT ' 210 PRINT "File not found": END ' 220 X = PEEK(DIRPTR+11) ' 230 IF X AND 32 <> 0 THEN PRINT "File not baked up" 240 IF X AND 16 <> 0 THEN PRINT "File is a subdirectory" 250 IF X AND 8 <> 0 THEN PRINT "Volume label - not a file" 260 IF X AND 4 <> 0 THEN PRINT "File is a system file" 270 IF X AND 2 <> 0 THEN PRINT "File is a hidden file" 280 IF X AND 1 <> 0 THEN PRINT "File is read-only" . 43H 21H , , , . FCB. [5.3.2], . FCB, , . , , - - , - , . 43H, 1 AL, - , CX ( CL, CH 0). AL 0, CX . DS:DX , . ASCII 0 ( 63- ). "hidden" () OVERDUE: ;--- PATH DB 'A:ACCOUNTS',0 ;--- MOV AH,43H ; MOV AL,0 ; LEA DX,PATH ;DS:DX INT 21H ; CX JC ERROR_ROUTINE ; OR CL,10B ; 1 MOV AH,43H ; MOV AL,1 ; INT 21H ; . AX 2 - , 3 - 5 - ( ). 5.2.7 / . - , - . 11 , - . 11 8 ( 3 = 1). . , DIR. . , 8. E5 - . 11 ( ). , , , . . [5.4.2] . 0, 0, - 6 / - 7. , , , . . : . : 100 ' , &H1000 110 DEF SEG = &H1000 120 DIRPTR = 11 ' 130 FOR N = 1 TO 112 ' 140 IF PEEK(DIRPTR) = 8 THEN 180 ' 150 DIRPTR = DIRPTR + 32 ' . 160 NEXT ' 170 PRINT "No volume label found": END ' 180 INPUT "Enter new volume label", V$ ' 190 IF LEN(V$) > 11 THEN BEEP: PRINT "11 chars only": GOTO 180 200 V$ = V$ + STRING$(11-LEN(V$),32) ' 210 DIRPTR = DIRPTR - 11 ' 220 FOR N = 1 TO LEN(V$) ' 230 POKE N,MID$(V$,N,1) ' 240 NEXT ' 250 ' . , 3584 , - 360K. DIR_AREA. , , , . ; , [1.3.1]. ;--- VOL_STRING DB 'The volume label is $' NO_LABEL DB 'There is no volume label $' DIR_AREA DB 3584 DUP(?) ;--- 7 MOV AX,SEG DIR_AREA ; MOV ES,AX ; MOV BX,OFFSET DIR_AREA ; MOV DL,0 ; MOV DH,0 ; MOV CH,0 ; MOV CL,6 ; MOV AL,7 ; MOV AH,2 ; INT 13H ; ;--- , 8 MOV CX,112 ; ADD BX,11 ; TRY_AGAIN: MOV AL,[BX] ; 1- CMP AL,8 ; ? JE GOT_IT ; , ADD BX,32 ; . LOOP TRY_AGAIN ; ;--- MOV AH,9 ; LEA DX,NO_LABEL ; INT 21H ; JMP SHORT CONTINUE ; ;--- , GOT_IT: MOV AH,9 ; LEA DX,VOL_STRING ; INT 21H ; SUB BX,11 ; MOV CX,11 ; 11 MOV AH,2 ; NEXT_CHAR: MOV DL,[BX] ; DL INT 21H ; INC BX ; LOOP NEXT_CHAR ; CONTINUE: GOT_IT: GOT_IT: MOV AL,0E5H ; SUB BX,11 ; MOV [BX],AL ; , GOT_IT . , - 11- NEW_LABEL. GOT_IT: LEA SI,NEW_LABEL ;SI SUB BX,11 ;BX MOV DI,BX ; DI MOV CX,11 ; 11 REP MOVSB ; , 8 ( ASCII 8 , , ). , , , . . ;--- MOV AX,SEG DIR_AREA ; MOV ES,AX ; MOV BX,OFFSET DIR_AREA ; MOV DL,0 ; MOV DH,0 ; MOV CH,0 ; MOV CL,6 ; MOV AL,7 ; MOV AH,3 ; INT 13H ;  3. . , . - , - /. MS DOS , (FCB) . FCB , MS DOS , , . , , . - , FCB , MS DOS , - . . , - . / , FCB. , - - , - FCB - . . , MS DOS, , , , .. , , . - FCB, , MS DOS . FCB ; , . , MS DOS . MS DOS 16- "" DOS - , . - , - . MS DOS , ASCII 0, ( ASCIIZ). , - . (.. ). , , . , . , . - , . (disk transfer area) DTA. , IBM PC DTA , DTA. DTA - , . , , , DTA, . 5-2 . 5.3.1 / . , , . , - . . - . - 7 . X$, Z . - - . 110, 0 = A, 1 = B .. - , , . 120 130 - , - . 100 DEF SEG ' 110 NUM = 0 ' A 120 X$ = CHR$(180)+CHR$(14)+CHR$(178)+CHR$(NUM)+CHR$(205)+ CHR(33)+CHR$(223) 130 Y = VARPTR(X$) ' ( Y+1) 140 Z = PEEK(Y+1)+PEEK(Y+2)*256 ' 150 CALL Z ' . EH 21H - . (0 = A, 1 = B ..) DL . AL . , , 2. - [1.1.5]. MOV AH,0EH ; MOV DL,1 ; B INT 21H ; 19H 21H - . . AL , 0 = A, 1 = B .. 5.3.2 / . , . , 0. , ( ) E5H. - . - , . . - - , - . . . , , . , , 1 ( - Ctrl-Z - ASCII 26 - - ). OPEN . [5.3.3]. , CLOSE . KILL. . , KILL "A:ACCOUNT.DAT". , - , , KILL "A:\FINANCES\ACCOUNT.DAT". . , - , ( ) - RMDIR. . , . . , , , . , , - , . , ( ) , , . FCB: 16H 21H . FCB DS:DX . . , , . , - , 11H 21H [5.2.1]. , - AL 0; , AL FF. (, ) [5.2.6] [5.3.5]. . : ;--- FCB DB 1,'MYFILE DAT',25 DUP(0) ;--- MOV AH,11H ; LEA DX,FCB ;DS:DX FCB INT 21H ; CMP AL,0 ;AL = 0 JE WARN_USER ; , ;--- MOV AH,16H ; INT 21H ; , - , . [5.2.6]. - FCB 7- , FFH, 5 ASCII 0, . , 1 . , , : FCB DB 0FFH,5 DUP(0),2,1,'MYFILE DAT',25 DUP(0) 13H 21H . DS:DX FCB . , AL FF, 0. ( , ) . : ;--- FCB DB 1,'MYFILE DAT',25 DUP(0) ;--- MOV AH,13H ; LEA DX,FCB ;DS:DX FCB INT 21H ; CMP AL,0FFH ; JE DELETE_ERROR ; : 3CH 21H . DS:DX , MS DOS, , . ASCII 0. - [5.2.6] CX (0 - ). . , AX . 1, AX , 3, , 4 - 5 - - . , , , . - 4EH 21H . ;--- PATH DB 'B:LEVEL1\LEVEL2\FILENAME.EXT',0 ;--- MOV AH,4EH ; LEA DX,PATH ;DS:DX INT 21H ; JNC WARN_USER ; , ;--- MOV AH,3CH ; MOV CX,0 ; INT 21H ; JC OPEN_ERROR ; MOV HANDLE,AX ; MS DOS 3.0 - . 5BH 21H. , 3CH, - , , . [7.2.5]. 41H 21H. DS:DX , . - . . , ; AL - 2, 5 - . , ; [5.2.6] . : ;--- PATH DB 'B:LEVEL1\LEVEL2\FILENAME.EXT',0 ;--- MOV AH,41H ; LEA DX,PATH ;DS:DX INT 21H ; JC DELETE_ERROR ; MS DOS 3.0 (5AH 21H) "" . , . . DS:DX , . . CX ( 0). AX , , AX . . , MS DOS 3.0; [7.2.5]. , - - 41H (. ). , : ;--- PATH DB 'B:LEVEL1\LEVEL2\',12 DUP(0) ;--- MOV AH,5AH ; LEA DX,PATH ;DS:DX INT 21H ; JC CREATION_ERROR ; . . MOV AH,41H ; LEA DX,PATH ;DS:DX INT 21H ; JC DELETION_ERROR ; 5.3.3 / . "" - , - (), . - , - . . , MS DOS . , , . - , . , . , . MS DOS 2.1 99 , 8 ( MS DOS FILES). 15 . - . , , , . , , , . . , . . , , - . . - , , . -, , 1, , , . - - , .. - . MYFILE.TXT , 2, OPEN "O",#2,"MYFILE.TXT" OPEN "MYFILE.TXT" FOR OUTPUT AS #2 , 2 #2. , - . , 0 6. 1 , 2. 8, 4 15. , 4 /. F: . , BASICA/F:10, 10 , - . , S:, . . 128 , 32767 . - 0, . - . , 512 512 , . BASICA/S:512/F:10 10 512 . 188 , 7K . , DOS. : OPEN - . - : "O" "I" "R" / , . , , . , , , , , - , . , OPEN. , (.. , ). , , OPEN "I",#1,"A:\LE- VEL1\LEVEL2\MYFILE.TXT". , OPEN "R",#3,"MYFILE.TXT",52. 52 . FIELDS 52 , . - . , - , 512 . 1 32767 128 . : OPEN , , . , "O" "I", INPUT OUTPUT ( ), , OPEN "FILENAME" FOR INPUT AS #1. : OPEN "MYFILE.TXT" AS #2. , APPEND, , - : OPEN "B:MYFILE.TXT" FOR APPEND AS #3. . LEN = . - OPEN "C:MYFILE.TXT" AS #1 LEN = 52 52 . . OPEN , - . - . 100 INPUT "Enter file name: ",F$ ' 110 IF INSTR(F$,".") <> 0 THEN 130 ' ? 120 IF LEN(F$) > 8 THEN 500 ELSE 150 ' 8 ? 130 IF LEN(F$) > 12 THEN 500 ' 12 ? 140 IF LEN(F$) - INSTR(F$,".") > 3 THEN 500 ' 3- 150 OPEN F$ FOR INPUT AS #1 ' . . 500 INPUT "Improper filename - enter another: ",F$ 510 GOTO 110 ' , : . CLOSE. CLOSE #1 CLOSE #1, #3. . , , . - , END, NEW, RESET, SYSTEM RUN , . . . MS DOS , - . , . - [5.3.2]. FCB: 0FH 21H . , [5.3.5]. FCB (0 = , 1 = A ..). DS:DX FCB, . AL 0, FF, . 0, , . ( - 128 ), ( , ). , . FCB, DS:DX FCB 10H 21H. , - , AL 0. , FF AL. ;--- FCB DB 1,'FILENAMEEXT',25 DUP(0) ;--- MOV AH,0FH ; LEA DX,FCB ;DS:DX FCB INT 21H ; CMP AL,0 ; JNE OPEN_ERROR ; . . ;--- MOV AH,10H ; LEA DX,FCB ;DS:DX FCB INT 21H ; CMP AL,0 ; JNE CLOSE_ERROR ; : 3DH 21H. DS:DX , , - , . 63-