home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Z3LIB Module Name: Z3PFNX
- ; Author: Richard Conn
- ; Z3LIB Version Number: 1.3
- ; Module Version Number: 1.1
- ;
- public putfnx
-
- ext envptr
-
- ;
- ; PUTFNX sets the nth filename.typ to the FCB-entry pted to by HL
- ; (FCB+1 is pointed to by HL). On input, A=1 to 4 and HL pts to FCB+1.
- ; On output, A=0 and Zero Flag set if input A was out of range.
- ;
- putfnx:
- dec a ;check range
- cp 4 ;0 to 3 is valid
- jp nc,pfnxerr
- inc a ;set offset to 1-4 again
- push de
- push hl
- 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
- pfnx1:
- dec a ;count down
- jp z,pfnx2
- add hl,de ;pt to next
- jp pfnx1
- pfnx2:
- pop de ;get ptr to FCB+1
- push de
- push bc ;save BC
- ld b,11 ;11 bytes from DE to HL
- pfnx3:
- ld a,(de) ;copy
- ld (hl),a
- inc hl ;pt to next
- inc de
- dec b ;count down
- jp nz,pfnx3
- pop bc ;restore regs
- pop hl
- pop de
- or 0ffh ;set NZ for OK
- ret
- pfnxerr:
- xor a ;error
- ret
-
- end