G10CLSE ; - RET ; DOS BEGIN ENDP ; : ; ------------------------ C10OPEN PROC NEAR MOV AH,16H ; LEA DX,FCBREC INT 21H CMP AL,00 ; ? JNZ C20 ; - MOV FCBRCSZ,RECLEN ; (EQU) LEA DX,NAMEDTA ; DTA MOV AH,1AH INT 21AH RET C20: LEA DX,OPNMSG ; CALL X10ERR RET C10OPEN ENDP ; : ; ----------------- D10PROC PROC NEAR MOV AH,09 ; LEA DX,PROMPT ; INT 21H MOV AH,0AH ; LEA DX,NAMEPAR ; INT 21H CALL E10DISP ; CMP NAMELEN,00 ; ? JNE D20 ; - , RET ; - D20: MOV BH,00 ; Return MOV BL,NAMELEN MOV NAMEDTA[BX],' ' ; CALL F10WRIT ; ; CLD LEA DI,NAMEDTA ; MOV CX,RECLEN / 2 ; MOV AX,2020H ; REP STOSW RET ; D10PROC ENDP ; : IBM PC. . 109 ; ----------------------------- E10DISP PROC NEAR MOV AH,09 ; LEA DX,CRLF ;CR/LF INT 21H ; DOS CMP ROW,18 ; ? JAE E20 ; - , INC ROW ; - RET E20: MOV AX,0601H ; 1 CALL Q10SCR CALL Q20CURS ; RET E10DISP ENDP ; : ; -------------- F10WRIT PROC NEAR MOV AH,15H ; LEA DX,FCBREC INT 21H CMP AL,00 ; ? JZ F20 ; LEA DX,WRTMSG ; - CALL X10ERR ; MOV NAMELEN,00 F20: RET F10WRIT ENDP ; : ; ------------------------ G10CLSE PROC NEAR MOV NAMEDTA,1AH ; EOF CALL F10WRIT MOV AH,10H ; LEA DX,FCBREC INT 21H RET G10CLSE ENDP ; : ; ---------------- Q10SCR PROC NEAR ;AX MOV BH,1EH ; MOV CX,0000 MOV DX,184FH INT 10H ; RET Q10SCR ENDP ; : ; ----------------- Q20CURS PROC NEAR MOV AH,02 MOV BH,00 MOV DL,00 IBM PC. . 110 MOV DH,ROW ; INT 10H RET Q20CURS ENDP ; : ; ---------------------------------- X10ERR PROC NEAR MOV AH,09 ;DX INT 21H ; MOV ERRCDE,01 ; RET X10ERR ENDP CODESG ENDS END BEGIN IBM PC. . 111 TITLE FCBREAD (EXE) CREATDSK ; ------------------------------------------------------- STACKSG SEGMENT PARA STACK 'Stack' DW 80 DUP(?) STACKSG ENDS ;-------------------------------------------------------- DATASG SEGMENT PARA 'Data' FCBREC LABEL BYTE ;FCB FCBDRIV DB 04 ; D FCBNAME DB 'NAMEFILE' ; FCBEXT DB 'DAT' ; FCBBLK DW 0000 ; FCBRCSZ DW 0000 ; DD ? ; (DOS) DW ? ; (DOS) DT ? ; (DOS) FCBSQRC DB 00 ; DD ? ; RECLEN EQU 32 ; NAMEFLD DB RECLEN DUP(' '), 13, 10, '$' ENDCDE DB 00 OPENMSG DB '*** Open error ***', '$' READMSG DB '*** Read error ***', '$' ROW DB 00 DATASG ENDS ;-------------------------------------------------------- CODESG SEGMENT PARA 'Code' BEGIN PROC FAR ASSUME CS:CODESG,DS:DATASG,SS:STACKSG,ES:DATASG PUSH DS SUB AX,AX PUSH AX MOV AX,DATASG MOV DS,AX MOV ES,AX MOV AX,0600H CALL Q10SCR ; CALL Q20CURS ; CALL E10OPEN ; , ; DTA CMP ENDCDE,00 ; ? JNZ A90 ; - A20LOOP: CALL F10READ ; CMP ENDCDE,00 ; ? JNZ A90 ; - CALL G10DISP ; JMP A20LOOP ; A90: RET ; BEGIN ENDP IBM PC. . 112 ; : ; ----------------------- E10OPEN PROC NEAR LEA X,FCBREC MOV AH,0FH ; INT 21H CMP AL,00 ; ? JNZ E20 ; - MOV FCBRCSZ,RECLEN ; (EQU) MOV AH,1AH LEA DX,NAMEFLD ; DTA INT 21H RET E20: MOV ENDCDE,01 ; LEA DX,OPENMSG CALL X10ERROR RET E10OPEN ENDP ; : ; ---------------------- F10READ PROC NEAR MOV AH,14H ; LEA DX,FCBREC INT 21H CMP NAMEFLD,1AH ; EOF? JNE F20 ; MOV ENDCDE,01 ; JMP F90 F20: CMP AL,00 ; ? JZ F90 ; - MOV ENDCDE,01 ;: CMP AL,01 ; ? JZ F90 ; - , LEA DX,READMSG ; - CALL X10ERR ; F90: RET F10READ ENDP ; : ; --------------------- G10DISP PROC NEAR MOV AH,09 ; LEA DX,NAMEFLD INT 21H CMP ROW,20 ; ? JAE G30 ; - INC ROW ; - JMP G90 G30: MOV AX,0601H IBM PC. . 113 CALL Q10SCR ; CALL Q20CURS ; G90: RET G10DISP ENDP ; () : ; ---------------------------- Q10SCR PROC NEAR ;AX MOV BH,1EH ; MOV CX,0000 MOV DX,184FH ; INT 10H RET Q1OSCR ENDP ; : ; ----------------- Q20CURS PROC NEAR MOV AH,02 MOV BH,00 MOV DH,ROW MOV DL,00 INT 10H RET Q20CURS ENDP ; : ; ---------------------------------- X10ERR PROC NEAR MOV AH,09 ;DX INT 21H ; RET X10ERR ENDP CODESG ENDS END BEGIN page 60,132 TITLE RANREAD (COM) , ; FCBCREAT CODESG SEGMENT PARA 'Code' ASSUME CS:CODESG,DS:CODESG,SS:CODESG,ES:CODESG ORG 100H BEGIN: JMP MAIN ;----------------------------------------------------- FCBREC LABEL BYTE ;FCB FCBDRIV DB 04 ; D FCBNAME DB 'MAMEFILE' ; FCBEXT DB 'DAT' ; FCBBLK DW 0000 ; FCBRCSZ DW 0000 ; DD ? ; (DOS) DW ? ; (DOS) DT ? ; (DOS) IBM PC. . 114 DB 00 ; FCBRNRC DD 000000000 ; RECLEN EQU 32 ; RECDPAR LABEL BYTE ; : MAXLEN DB 3 ; ACTLEN DB ? ; RECDNO DB 3 DUP(' ') ; NAMEFLD DB RECLEN DUP(' '),13,10,'$' ;DTA OPENMSG DB '*** Open error ***',13,10,'$' READMSG DB '*** Read error ***',13,10,'$' COL DB 00 PROMPT DB 'Record number? $' ROW DB 00 ENDCDE DB 00 ;----------------------------------------------------- MAIN PROC NEAR CALL Q10CLR ; CALL Q20CURS ; CALL C10OPEN ; , ; DTA CMP ENDCDE,00 ; ? JZ A20LOOP ; - , RET ; - A20LOOP: CALL D10RECN ; CMP ACTLEN,00 ; ? JE A40 ; - CALL F10READ ; ( ) CMP ENDCDE,00 ; ? JNZ A30 ; - CALL G10DISP ; A30: JMP A20LOOP A40: RET ; MAIN ENDP ; : ; ------------------------------------ C10OPEN PROC NEAR MOV AH,0FH ; LEA DX,FCBREC INT 21H CMP AL,00 ; ? JNZ C20 ; - MOV FCBRCSZ,RECLEN ; (EQU) MOV AH,1AH LEA DX,NAMEFLD ; DTA INT 21H RET C20: LEA DX,OPENMSG IBM PC. . 115 CALL X10ERR RET C10OPEN ENDP ; : ; ------------------------------- D10RECN PROC NEAR MOV AH,09H ; LEA DX,PROMPT INT 21H MOV AH,0AH ; LEA DX,RECDPAR INT 21H CMP ACTLEN,01 ; (0,1,2) JB D40 ; 0, JA D20 SUB AH,AH ; 1 MOV AL,RECDNO JMP D30 D20: MOV AH,RECDNO ; 2 MOV AL,RECDNO+1 D30: AND AX,0F0FH ; ASCII AAD MOV WORD PTR FCBRNRC,AX D40: MOV COL,20 CALL Q20CURS ; RET D10RECN ENDP ; : ; ---------------------- F10READ PROC NEAR MOV ENDCDE,00 ; MOV AH,21H ; LEA DX,FCBREC INT 21H CMP AL,00 ; ? JZ F20 ; - LEA DX,READMSG ; - CALL X10ERR ; F20: RET F10READ ENDP ; : ; -------------------- G10DISP PROC NEAR MOV AH,09 ; LEA DX,NAMEFLD INC 21H INC ROW MOV COL,00 RET G10DISP ENDP IBM PC. . 116 ; : ; -------------- Q10CLR PROC NEAR MOV AX,0600H ; MOV BH,41H ; (07 /) MOV CX,0000 MOV DX,184FH INT 10H RET Q10CLR ENDP ; : ; ----------------- Q20CURS PROC NEAR MOV AH,02 ; MOV BH,00 ; MOV DH,ROW MOV DL,COL INT 10H RET Q20CURS ENDP ; : ; ---------------------------------- X10ERR PROC NEAR MOV AH,09 ;DX INT 21H ; INC ROW MOV ENDCDE,01 RET X10ERR ENDP CODESG ENDS END BEGIN IBM PC. . 117 TITLE RANBLOK (COM) CODESG SEGMENT PARA 'Code' ASSUME CS:CODESG,DS:CODESG,SS:CODESG,ES:CODESG ORG 100H BEGIN: JMP MAIN ;---------------------------------------------------- FCBREC LABEL BYTE ;FCB FCBDRIV DB 04 ; D FCBNAME DB 'NAMEFILE' ; FCBEXT DB 'DAT' ; FCBBLK DW 0000 ; FCBRCSZ DW 0000 ; FCBFLZ DD ? ; DOS DW ? ; DOS DT ? ; DOS DB 00 ; FCBRNRC DD 00000000 ; DSKRECS DB 1024 DUP(?),'$' ;DTA ENDCODE DB 00 NORECS DW 25 ; OPENMSG DB '*** Open error ***',13,10,'$' READMSG DB '*** Open error ***',13,10,'$' ROWCTR DB 00 ; --------------------------------------------------- MAIN PROC NEAR CALL Q10CLR ; CALL Q20CURS ; CALL E10OPEN ; , ; DTA CMP ENDCODE,00 ; ? JNZ A30 ; - CALL F10READ ; CALL G10DISP ; A30: RET ; MAIN ENDP ; : ; --------------------- E10OPEN PROC NEAR MOV AH,0FH ; LEA DX,FCBREC INT 21H CMP AL,00 ; ? JNZ A30 ; - MOV FCBRCSZ,0020H ; MOV AH,1AH LEA DX,DSKRECS ; DTA INT 21H RET E20: IBM PC. . 118 LEA DX,OPENMSG ; CALL X10ERR RET E10OPEN ENDP ; : ; ------------ F10READ PROC NEAR MOV AH,27H ; MOV CX,NORECS ; LEA DX,FCBREC INT 21H MOV ENDCODE,AL ; RET F10READ ENDP ; : ; -------------------- G10DISP PROC NEAR MOV AH,09 ; LEA DX,DSKRECS INT 21H RET G10DISP ENDP ; : Q10CLR PROC NEAR MOV AX,0600H ; MOV BH,41H ; (07 /) MOV CX,0000 MOV DX,184FH INT 10H RET Q10CLR ENDP ; : ; ------------------------------ Q20CURS PROC NEAR MOV AH,02 ; MOV BH,00 MOV DH,ROWCTR MOV DL,00 INT 10H INC ROWCTR RET Q20CURS ENDP ; : ; -------------------------------------- X10ERR PROC NEAR MOV AH,09 ;DX INT 21H ; MOV ENDCODE,01 RET X10ERR ENDP CODESG ENDS END BEGIN IBM PC. . 119 TITLE SELDEL (COM) ; ; ; : *.*, *.BAK, .. CODESG SEGMENT PARA 'Code' ASSUME CS:CODESG,DS:CODESG,SS:CODESG ORG 100H BEGIN JMP MAIN ; ---------------------------------------------------------- TAB EQU 09 LF EQU 10 CR EQU 13 CRLF DB CR,LF,'$' DELMSG DB TAB,'Erase','$' ENDMSG DB CR,LF,'No more directory entries',CR,LF,'$' ERRMSG DB 'Write protected disk','$' PROMPT DB 'y = Erase, N = Keep, Ret = Exit',CR,LF,'$' ; ---------------------------------------------------------- MAIN PROC NEAR ; MOV AH,11H ; CALL D10DISK CMP AL,0FFH ; , JE A90 ; LEA DX,PROMPT ; CALL B10DISP A20: LEA DX,DELMSG ; CALL B10DISP ; MOV CX,11 ;11 MOV SI,81H ; A30: MOV DL,[SI] ; CALL C10CHAR ; INC SI ; LOOP A30 MOV DL,'?' CALL C10CHAR MOV AH,01 ; INT 21H ; CMP AL,ODH ; Return? JE A90 ; - OR AL,00100000B ; ; CMP AL,'y' ; ? JNE A50 ; - , MOV AH,13H ; - MOV DX,80H INT 21H CMP AL,0 ; ? JZ A50 ; - LEA DX,ERRMSG ; - CALL B10DISP ; JMP A90 IBM PC. . 120 A50: LEA DX,CRLF ; CALL B10DISP MOV AH,12H CALL B10DISK ; CMP AL,0FFH ; ? JNE A20 ; - A90: RET ; DOS MAIN ENDP ; ; ; --------------------- B10DISP PROC NEAR ; DX MOV AH,09 ; INT 21H RET B10DISP ENDP ; ; ; ---------------------- C10CHAR PROC NEAR ; DL MOV AH,02 INT 21H RET C10CHAR ENDP ; : ; ------------------------ D10DISK PROC NEAR MOV DX,5CH ; FCB INT 21H CMP AL,0FFH ; ? JNE D90 PUSH AX ; AL LEA DX,ENDMSG CALL B10DISP POP AX ; AL D90: RET D10DISK ENDP CODESG ENDS END BEGIN IBM PC. . 121 page 60,132 TTILE HANCREAT (EXE) ; ----------------------------------------------------- STACKSG SEGMENT PARA STACK 'Stack' DW 80 DUP(?) STACKSG ENDS ; ----------------------------------------------------- DATASG SEGMENT PARA 'Data' NAMEPAR LABEL BYTE ; : MAXLEN DB 30 ; NAMELEN DB ? ; NAMEREC DB 30 DUP(' '), 0DH, 0AH ; , ; CR/LF ERRCDE DB 00 HANDLE DW ? PATHNAM DB 'D:\NAMEFILE.DAT',0 PROMPT DB 'Name? ' ROW DB 01 OPNMSG DB '*** Open error ***', 0DH, 0AH WRTMSG DB '*** Write error ***', 0DH, 0AH DATASG ENDS ; ------------------------------------------------------- CODESG SEGMENT PARA 'Code' BEGIN PROC FAR ASSUME CS:CODESG,DS:DATASG,SS:STACKSG,ES:DATASG PUSH DS SUB AX,AX PUSH AX MOV AX,DATASG MOV DS,AX MOV ES,AX MOV AX,0600H CALL Q10SCR ; CALL Q20CURS ; CALL C10CREA ; , ; DTA CMP ERRCDE,00 ; ? JZ A20LOOP ; - , RET ; - DOS A20LOOP: CALL D10PROC CMP NAMELEN,00 ; ? JNE A20LOOP ; - , CALL G10CLSE ; - RET ; DOS BEGIN ENDP ; : ; ----------------------- C10CREA PROC NEAR MOV AH,3CH ; MOV CX,00 ; LEA CX,PATHNAM IBM PC. . 122 INT 21H JC C20 ; ? MOV HANDLE,AX ; - , RET C20: ; - LEA DX,OPNMSG ; CALL X10ERR ; RET C10CREA ENDP ; : ; ----------------- D10PROC PROC NEAR MOV AH,40H ; MOV BX,01 ; (Handle) MOV CX,06 ; LEA DX,PROMPT ; INT 21H MOV AH,0AH ; LEA DX,NAMEPAR ; INT 21H CMP NAMELEN,00 ; ? JNE D20 ; - RET ; - D20: MOV AL,20H ; SUB CH,CH MOV CL,NAMELEN ; LEA DI,NAMEREC ; ADD DI,CX ; + NEG CX ; ADD CX,30 ; REP STOSB ; D90: CALL F10WRIT ; CALL E10SCRL ; RET D10PROC ENDP ; : ; -------------------- E10SCRL PROC NEAR CMP ROW,18 ; JAE E10 ; - , INC ROW ; - JMP E10 E10: MOV AX,0601H ; CALL Q10SCR E90: CALL Q20CURS ; RET E10SCRL ENDP ; : ; -------------- IBM PC. . 123 F10WRIT PROC NEAR MOV AH,40H ; MOV BX,HANDLE MOV CX,32 ;30 + 2 CR/LF LEA DX,NAMEREC INT 21H JNC F20 ; ? LEA DX,WRTMSG ; - CALL X10ERR ; MOV NAMELEN,00 F20: RET F10WRIT ENDP ; : ; ----------------------- G10CLSE PROC NEAR MOV NAMEREC,1AH ; (EOF) CALL F10WRIT MOV AH,3EH ; MOV BX,HANDLE INT 21H RET G10CLSE ENDP ; () : ; ---------------------------- Q10SCR PROC NEAR ; AX - MOV BH,1EH ; - MOV CX,0000 MOV DX,184FH INT 10H ; RET Q10SCR ENDP ; : ; ----------------- Q20CURS PROC NEAR MOV AH,02 MOV BH,00 MOV DH,ROW ; MOV DL,00 INT 10H RET Q20CURS ENDP ; : ; ------------------------- X10ERR PROC NEAR ;DX MOV AH,40H ; MOV BX,01 MOV CX,21 ; INT 21H MOV ERRCDE,01 ; RET X10ERR ENDP IBM PC. . 124 CODESG ENDS END BEGIN IBM PC. . 125 page 60,132 TITLE HANREAD (EXE) , HANCREAT ; ----------------------------------------------------- STACKSG SEGMENT PARA STACK 'Stack' DW 80 DUP(?) STACKSG ENDS ; ----------------------------------------------------- DATASG SEGMENT PARA 'Data' ENDCDE DB 00 HANDLE DW ? IOAREA DB 32 DUP(' ') PATHNAM DB 'D:\NAMEFILE.SRT',0 OPENMSG DB '*** Open error ***', 0DH, 0AH READMSG DB '*** Read error ***', 0DH, 0AH ROW DB 00 DATASG ENDS ; ------------------------------------------------------ CODESG SEGMENT PARA 'Code' BEGIN PROC FAR ASSUME CS:CODESG,DS:DATASG,SS:STACKSG,ES:DATASG PUSH DS SUB AX,AX PUSH AX MOV AX,DATASG MOV DS,AX MOV ES,AX MOV AX,0600H CALL Q10SCR ; CALL Q20CURS ; CALL E100PEN ; , ; ; DTA CMP ENDCDE,00 ; ? JNZ A90 ; - A20LOOP: CALL F10READ ; CMP ENDCDE,00 ; ? JNZ A90 ; - , CALL G10DISP ; - , JMP A20LOOP ; A90: RET BEGIN ENDP ; : ; -------------- E100PEN PROC NEAR MOV AH,3DH ; MOV CX,00 ; LEA DX,PATHNAM INT 21H JC E20 ; ? MOV HANDLE,AX ; - RET ; E20: IBM PC. . 126 MOV ENDCDE,01 ; - LEA DX,OPENMSG ; CALL X10ERR RET E100PEN ENDP ; : ; ---------------------- F10READ PROC NEAR MOV AX,3FH ; MOV BX,HANDLE MOV CX,32 ;30 , 2 CR/LF LEA DX,IOAREA INT 21H JC F20 ; ? CMP AX,00 ; ? JE F30 CMP IOAREA,1AH ; (EOF)? JE F30 ; - RET F20: LEA DX,READMSG ; - CALL X10ERR ; F30: MOV ENDCDE,01 ; F90: RET F10READ ENDP ; : ; -------------------- G10DISP PROC NEAR MOV AH,40H ; MOV BX,01 ; MOV CX,32 ; LEA DX,IOAREA INT 21H CMP ROW,20 ; ? JEA G90 ; - INC ROW RET G90: MOV AX,0601H CALL Q10SCR ; () CALL Q20CURS ; RET G10DISP ENDP ; () : ; ---------------------------- Q10SCR PROC NEAR ; AX - MOV BH,1EH ; MOV CX,0000 MOV DXX,184FH ; INT 10H RET Q10SCR ENDP IBM PC. . 127 ; : ; ----------------- Q20CURS PROC NEAR MOV AH,02 ; MOV BH,00 ; MOV DH,ROW ; MOV DL,00 ; INT 10H RET Q20CURS ENDP ; : ; ------------------------- X10ERR PROC NEAR MOV AH,40H ; DX - MOV BX,01 ; MOV CX,20 ; INT 21H RET X10ERR ENDP CODESG ENDS END BEGIN IBM PC. . 128 page 60,132 TITLE ASCREAD (COM) ASCII CODESG SEGMENT PARA 'Code' ASSUME CS:CODESG,DS:CODESG,SS:CODESG,ES:CODESG ORG 100H BEGIN: JMP MAIN ; ------------------------------------------------- SECTOR DB 512 DUP(' ') ; DISAREA DB 120 DUP(' ') ; ENDCDE DW 00 HANDLE DW 0 OPENMSG DB '*** Open error ***' PATHNAM DB 'D:\HANREAD.ASM', 0 ROW DB 00 ; ------------------------------------------------- MAIN PROC NEAR ; MOV AX,0600H CALL Q10SCR ; CALL Q20CURS ; CALL E10OPEN ; , ; DTA CMP ENDCDE,00 ; ? JNE A90 ; - , A20LOOP: ; - CALL R10READ ; CMP ENDCDE,00 ; , ? JE A90 ; - CALL G10XPER ; A90: RET ; MAIN ENDP ; : ; --------------------- E10OPEN PROC NEAR MOV AH,3DH ; MOV AL,00 ; LEA DX,PATHNAM INT 21H JNC E20 ; CF CALL X10ERR ; , RET E20: MOV HANDLE,AX ; RET E10OPEN ENDP ; : ; -------------------------------- G10XPER PROC NEAR CLD ; - LEA SI,SECTOR G20: LEA DI,DISAREA G30: IBM PC. . 129 LEA DX,SECTOR+512 CMP SI,DX ; ? JNE G40 ; - , CALL R10READ ; - CMP ENDCDE,00 ; ? JE G80 ; - LEA SI,SECTOR G40: LEA DX,DISAREA+80 CMP DI,DX ; DISAREA? JB G50 ; - , MOV [DI],0D0AH ; - CR/LF CALL H10DISP ; LEA DI,DISAREA G50: LODSB ; [SI] AL ; SI STOSB ; AL [DI] ; DI CMP AL,1AH ; ? JE G80 ; - CMP AL,0AH ; ? JNE G30 ; - , CALL H10DISP ; - JMP G20 G80: CALL H10DISP ; G90: RET G10XPER ENDP ; : ; --------------------- H10DISP PROC NEAR MOV AH,40H ; MOV BX,01 ; (Handle) LEA CX,DISAREA ; NEG CX ; ADD CX,DI ; LEA DX,DISAREA INT 21H CMP ROW,22 ; ? JAE H20 ; - INC ROW JMP H90 H20: MOV AX,0601H ; () CALL Q10SCR CALL Q20CURS H90: RET H10DISP ENDP ; : ; ----------------------- R10READ PROC NEAR MOV AH,3FH ; IBM PC. . 130 MOV BX,HANDLE ; MOV CX,512 ; LEA DX,SECTOR ; INT 21H MOV ENDCDE,AX RET R10READ ENDP ; () : ; ---------------------------- Q10SCR PROC NEAR ; AX MOV BH,1EH ; MOV CX,0000 ; MOV DX,184FH INT 10H RET Q10SCR ENDP ; : ; ----------------- Q20CURS PROC NEAR MOV AH,02 ; MOV BH,00 ; MOV DH,ROW MOV DL,00 INT 10H RET Q20CURS ENDP ; : ; ---------------------------------- X10ERR PROC NEAR MOV AH,40H ; MOV BX,01 ; MOV CX,18 ; LEA DX,OPENMSG INT 21H MOV ENDCDE,O1 ; RET X10ERR ENDP CODESG ENDS END BEGIN IBM PC. . 131 TITLE GETPATH (COM) CODESG SEGMENT PARA 'Code' ASSUME CS:CODESG,DS:CODESG,ES:CODESG ORG 100H BEGIN: JMP SHORT MAIN ; ----------------------------------------------- PATHNAM DB 65 DUP(' ') ; ; ----------------------------------------------- MAIN PROC NEAR MOV AH,19H ; INT 21H ADD AL,41H ; . MOV DL,AL ; : 0=A, 1=B ... CAL B10DISP ; , MOV DL,':' CAL B10DISP ; , MOV DL,'\' CAL B10DISP ; MOV AH,47H ; MOV DL,00 LEA SI,PATHNAM INT 21H A10LOOP: CMP BYTE PTR [SI],0 ; JE A20 ; - MOV AL,[SI] ; MOV DL,AL ; CALL B10DISP ; INC SI JMP A10LOOP A20: RET ; DOS MAIN ENDP B10DISP PROC NEAR MOV AH,02 ; DL - INT 21H ; RET B10DISP ENDP CODESG ENDS END BEGIN IBM PC. . 132 TITLE BIOREAD (COM) BIOS CODESG SEGMENT PARA 'Code' ASSUME CS:CODESG,DS:CODESG,SS:CODESG,ES:CODESG ORG 100H BEGIN JMP MAIN ; --------------------------------------------------------- RECDIN DB 512 DUP(' ') ; ENDCDE DB 00 CURADR DW 0304H ; (/) ENDADR DW 0501H ; (/) READMSG DB '*** Read error ***$' SIDE DB 00 ; --------------------------------------------------------- MAIN PROC NEAR MOV AX,0600H ; A20LOOP: CALL Q10SCR ; CALL Q20CURS ; CALL C10ADDR ; MOV CX,CURADR MOV DX,ENDADR CMP CX,DX ; ? JE A90 ; - CALL F10READ ; CMP ENDCDE,00 ; ? JNZ A90 ; - CALL G10DISP ; JMP A20LOOP ; A90 RET ; MAIN ENDP ; : ; ---------------------------------- C10ADDR PROC NEAR MOV CX,CURADR ; / CMP CL,10 ; ? JNE C90 ; - CMP SIDE,00 ;, = 0 JE C20 INC CH ; C20: XOR SIDE,01 ; MOV CL,01 ; = 1 MOV CURADR,CX C90: RET C10ADDR ENDP ; : ; ------------------------ F10READ PROC NEAR MOV AL,01 ; MOV AH,02 ; LEA BX,RECDIN ; MOV CX,CURADR ;/ IBM PC. . 133 MOV DH,SIDE ;