home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
USCX
/
PASTOOL3.ZIP
/
GETFCB.ASM
< prev
next >
Wrap
Assembly Source File
|
1982-10-26
|
2KB
|
48 lines
TITLE PASCAL CALLABLE ROUTINE TO FILL FCB FROM A DIRECTORY
PAGE ,132
;
; FUNCTION GETFCB (VARS IFCB : DOSFCB; {input fcb}
; VARS OFCB : DOSFCB; {output fcb}
; CONST FUNC: INTEGER); {1=RESTART SEARCH, 2=CONTINUE}
;
; You fill the IFCB with the filename info, and OFCB will be returned with
; all the FCB info for the file. Filename may contain wild characters on
; initial call. Returns TRUE if successful, FALSE otherwise.
;
;
CSEG SEGMENT
ASSUME CS:CSEG
PUBLIC GETFCB
GETFCB PROC FAR
PUSH BP ; SAVE BP REG
MOV DI,DS ; SAVE DS FOR PASCAL
MOV BP,SP ; BP = BASE OF PARM LIST
MOV BX,[BP]+10 ; SET DS/DX TO OUTPUT FCB ADDRESS
MOV DS,BX
MOV DX,[BP]+8
MOV AH,1AH ; SET DISK TRANSFER ADDRESS
INT 21H ; CALL DOS TO SET DTA
MOV BX,[BP]+14 ; SET DS/DX TO INPUT FCB ADDRESS
MOV DS,BX
MOV DX,[BP]+12
MOV AH,11H ; SPECIFY DOS SEARCH FOR FIRST DIRECTORY ENTRY
MOV SI,[BP]+6
CMP SI,02H ; SEE IF WE WANT TO CONTINUE INSTEAD
JNE L1 ; NOPE
MOV AH,12H ; SPECIFY DOS SEARCH CONTINUE
L1:
INT 21H ; CALL DOS TO GET DIRECTORY ENTRY
CMP AL,0 ; SEE IF ZERO RETURN CODE
JNE L2 ; NO, SET ERROR CODE
MOV AX,1 ; YES, SET RETURN TO 'TRUE'
JMP RETURN ; GET OUT OF HERE
L2:
MOV AX,0 ; SET RETURN TO 'FALSE'
RETURN:
MOV DS,DI ; RESTORE DS REGISTER
POP BP ; RESTORE BP REG
RET 0AH ; RETURN TO PASCAL
GETFCB ENDP
CSEG ENDS
END