2016-08-17 06:25:58 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Out : A = Command line Arg Count
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.GetArgC jsr S.InitArgPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPQuickPtr1)
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
jsr S.NextArgPtr1
|
|
|
|
|
inx
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.8 txa
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* In :
|
|
|
|
|
* A = Arg Index
|
|
|
|
|
* Out :
|
|
|
|
|
* CC : Y,A = PStr To Arg[A]
|
|
|
|
|
* CS : Out Of Bound
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.GetArgA sta K.GetArgA.Idx
|
2016-08-17 06:25:58 +00:00
|
|
|
|
jsr S.InitArgPtr1
|
|
|
|
|
|
2016-09-21 15:20:37 +00:00
|
|
|
|
lda K.GetArgA.Idx
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPQuickPtr1)
|
|
|
|
|
beq .9
|
|
|
|
|
|
2016-09-21 15:20:37 +00:00
|
|
|
|
cpx K.GetArgA.Idx
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
jsr S.NextArgPtr1
|
|
|
|
|
inx
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.8 >LDYA ZPQuickPtr1
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
S.InitArgPtr1 ldy #S.PS.hCMDLINE
|
|
|
|
|
lda (pPs),y
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMemPtrA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
>STYA ZPQuickPtr1
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
S.NextArgPtr1 lda ZPQuickPtr1
|
|
|
|
|
sec
|
|
|
|
|
adc (ZPQuickPtr1)
|
|
|
|
|
sta ZPQuickPtr1
|
|
|
|
|
bcc .8
|
|
|
|
|
inc ZPQuickPtr1+1
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.GetArgA.Idx .BS 1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE SYS/KERNEL.S.ARG
|
|
|
|
|
LOAD SYS/KERNEL.S
|
|
|
|
|
ASM
|