home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Z3LIB Module Name: Z3GFNX
- ; Author: Richard Conn
- ; Z3LIB Version Number: 1.3
- ; Module Version Number: 1.1
- ;
- public getfnx
-
- ext envptr
-
- ;
- ; GETFNX returns the address of the nth filename.typ entry in HL.
- ; HL only is affected. On input, A = 1 to 4 to identify the desired file.
- ;
- getfnx:
- dec a ;check range
- cp 4 ;0 to 3 is valid
- jp nc,error
- inc a ;set offset to 1-4 again
- push de
- push af ;save A
- ld hl,(envptr) ;pt to environment
- ld de,52h ;pt to file name entry
- add hl,de
- ld de,11 ;offset to next name
- pop af ;get A
- gfnx1:
- dec a ;count down
- jp z,gfnx2
- add hl,de ;pt to next
- jp gfnx1
- gfnx2:
- pop de ;restore regs
- or 0ffh ;set NZ for OK
- ret
- error:
- xor a ;error
- ret
-
- end