2016-08-17 06:25:58 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
2017-03-15 16:44:15 +00:00
|
|
|
|
LOMEM $A00
|
2016-08-17 06:25:58 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* #GetArgC
|
2016-10-25 06:58:15 +00:00
|
|
|
|
* Returns argument count in the process command line.
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* ##In:
|
|
|
|
|
* none.
|
|
|
|
|
* ##Out:
|
|
|
|
|
* A = Command line Arg Count (Including /path/cmd)
|
|
|
|
|
*\--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
K.GetArgC jsr ARG.InitArgPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.1 lda (ZPPtr1)
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
2016-09-29 15:30:15 +00:00
|
|
|
|
jsr ARG.NextArgPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
inx
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.8 txa
|
|
|
|
|
rts
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* #GetArgA
|
|
|
|
|
* ##In:
|
2016-10-25 06:58:15 +00:00
|
|
|
|
* A = argument index.
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* ##Out:
|
|
|
|
|
* CC : success
|
|
|
|
|
* Y,A = PStr To Arg[A]
|
2016-08-17 06:25:58 +00:00
|
|
|
|
* CS : Out Of Bound
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*\--------------------------------------
|
2016-09-26 16:00:52 +00:00
|
|
|
|
K.GetArgA sta .2+1
|
2016-09-29 15:30:15 +00:00
|
|
|
|
jsr ARG.InitArgPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2016-09-26 16:00:52 +00:00
|
|
|
|
lda .2+1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.1 lda (ZPPtr1)
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .9
|
|
|
|
|
|
2016-09-26 16:00:52 +00:00
|
|
|
|
.2 cpx #$ff Self Modified
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
2016-09-29 15:30:15 +00:00
|
|
|
|
jsr ARG.NextArgPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
inx
|
|
|
|
|
bra .1
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.8 >LDYA ZPPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
ARG.InitArgPtr1 ldy #S.PS.hCMDLINE
|
2016-08-17 06:25:58 +00:00
|
|
|
|
lda (pPs),y
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMemPtrA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ARG.NextArgPtr1 lda ZPPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
sec
|
2017-01-12 17:43:45 +00:00
|
|
|
|
adc (ZPPtr1)
|
|
|
|
|
sta ZPPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcc .8
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr1+1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE SYS/KERNEL.S.ARG
|
|
|
|
|
LOAD SYS/KERNEL.S
|
|
|
|
|
ASM
|