home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
JSAGE
/
ZSUS
/
PROGPACK
/
PARMLIB1.LBR
/
PPARGET.ZZ0
/
PPARGET.Z8°
Wrap
Text File
|
1989-07-10
|
1KB
|
51 lines
; Library: PARMLIB
; Version: 1.0
; Module: PARGET
; Version: 1.0
; Author: Carson Wilson
; Date: July 10, 1989
; Purpose: Gets pointer to CP/M command line parameter #A.
;
public parget
extrn parcnt ; PARMLIB
extrn sksp, sknsp ; SYSLIB
cpmcmd equ 80h ; CP/M command line location
;
; PARGET - Gets pointer to CP/M command line parameter #A.
;
; Entry: - <A> holds number of desired parameter.
; Exit: <F> - NZ if parameter found, Z if not found.
; <A> - holds first character of parameter, or 00 if not found.
; <HL> - points to parameter #A, if found.
; Uses: - <AF>, <HL>.
;
parget:
push bc
or a ; Just in case
ret z
ld b,a ; Save
call parcnt ; See how many parameters
cp b
ld a,0 ; For error exit
jr c,pargex ; A-th parameter does not exist
ld hl,cpmcmd+1 ; Always a space if parameters
pargt1:
call sknsp
call sksp ; Point to next parm.
djnz pargt1
ld a,(hl) ; 1st char.
pargex:
or a ; Set Z flag
pop bc
ret
end
; End PARGET.Z80