;****************************************
;* XCALL argument list, indexed by A3 *
;****************************************
.OFINI
.OFDEF COUNT,2 ; number of arguments
.OFDEF TYPE1,2 ; type of first argument
.OFDEF ADDR1,4 ; address of first argument
.OFDEF SIZE1,4 ; size of first argument
STRING=2 ; code for STRING argument
;*****************
;* Entry Point *
;*****************
SETLOG: PHDR -1,0,PH$REE!PH$REU ; reentrant, reusable
CMPW COUNT(A3),#1 ; exactly one argument specified?
JNE CNTERR ; no - error
CMPW TYPE1(A3),#STRING ; is argument a string?
JNE TYPERR ; no - error
SETUP: MOV ADDR1(A3),A2 ; point A2 to argument
JOBIDX A4 ; point A4 to Job Control Block
;*************************
;* Process Device Code *
;*************************
DEVICE: BYP ; skip spaces
ALF ; was a device code specified?
BNE PPN ; no
LEA A1,JOBDEV(A4) ; point to JCB device code
PACK ; set new device code
GTDEC ; get device number
MOVW D1,JOBDRV(A4) ; set drive number
CMPB @A2,#': ; colon present?
JNE FMTERR ; no - error
INC A2 ; skip colon
;*****************
;* Process PPN *
;*****************
PPN: BYP ; skip spaces
CMPB @A2,#'[ ; left bracket present?
BNE 10$ ; no
INC A2 ; yes - skip it
10$: NUM ; PPN present?
JNE FMTERR ; no - error
GTPPN ; get PPN
MOVW D1,JOBUSR(A4) ; set new PPN
RTN ; return to BASIC program