home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Du Jour
/
SoftwareDuJour.iso
/
BUSINESS
/
DBASE
/
DBAPG.ARC
/
DOS-PATH.A86
< prev
next >
Wrap
Text File
|
1984-01-22
|
2KB
|
56 lines
; Subroutine.: DOS-PATH.A86
; Author.....: Kelly Mc Tiernan
; Date.......: 01/22/84
; Notice.....: Copyright 1984, All Rights Reserved.
; Notes......: Accessing DOS 2.0 directories.
;
ORG DE00H ;56832 DECIMAL=TOP OF DBASE
;
START: MOV [SAVSTK],SP ; SAVE STACK POINTER
PUSH BX ; SAVE VAR POINTER
PUSHF ; SAVE FLAGS
;
MOV CL,[BX] ; GET VAR SIZE
MOV CH,00 ; ZERO HIGH BYTE FOR CX COUNTER
INC BX ; POINT TO FIRST BYTE OF CHAR
; STRING
MOV DX,BUFFER ; WHERE TO PUT PATH NAME
MOV DI,DX ; GET POINTER FOR STRING MOVE
MOV SI,BX ; SOURCE STRING=DBASE VAR "PATH"
CLD ; DIRECTION = UP
REP:MOVSB ; MOVE STRING TO BUFFER
MOV BYTE PTR[DI],00 ; STRING MUST BE TERMINATED WITH
; 00
MOV AH,00 ; DIRECTORY FUNCTIONS POKED FROM
; DBASE, MD=57, RD=58, CD=59
INT 21 ; MS-DOS FUNCTION CALL
JC ERROR ; FUNCTION ERROR, HANDLE AS
; GENERAL
;
MOV SP,[SAVSTK] ; RESTORE STACK POINTER
POPF ; RESTORE FLAGS
POP BX ; RESTORE VAR POINTER
RET ; RETURN TO DBASE
;
ERROR: DEC BX ; POINT TO LENGTH BYTE AGAIN
MOV CL,[BX] ; AND GET INTO COUNTER AGAIN
MOV CH,00
INC BX ; POINT TO FIRST CHAR. IN VAR
DEC CX ; COUNT=COUNT-1
MOV BYTE PTR[BX],'E'; 'E' IS ERROR CODE TO DBASE PRG.
INC BX ; POINT TO NEXT BYTE OF STRING
MOV DI,BX ; DESTINATION FOR SPACE FILL
MOV AL,20H ; ASCII SPACE
REP:STOSB ; FILL FOR COUNT=CX (1 LESS
; STRING LENGTH)
;
MOV SP,[SAVSTK] ; RESTORE STACK POINTER
POPF ; RESTORE FLAGS
POP BX ; RESTORE VAR POINTER
RET ; RETURN TO DBASE
;
;
SAVSTK RS 02
BUFFER DB 00 ; NO STORAGE RESERVED
END.