; 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: - holds number of desired parameter. ; Exit: - NZ if parameter found, Z if not found. ; - holds first character of parameter, or 00 if not found. ; - points to parameter #A, if found. ; Uses: - , . ; 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