mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-22 16:31:07 +00:00
76 lines
1.3 KiB
Plaintext
76 lines
1.3 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.SRC
|
||
NEW
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
* Out : A = Command line Arg Count
|
||
*--------------------------------------
|
||
S.GetArgC jsr S.InitArgPtr1
|
||
|
||
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
|
||
*--------------------------------------
|
||
S.GetArgA sta S.GetArgA.Idx
|
||
jsr S.InitArgPtr1
|
||
|
||
lda S.GetArgA.Idx
|
||
beq .8
|
||
|
||
ldx #0
|
||
|
||
.1 lda (ZPQuickPtr1)
|
||
beq .9
|
||
|
||
cpx S.GetArgA.Idx
|
||
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
|
||
jsr S.GetMemPtrA
|
||
>STYA ZPQuickPtr1
|
||
rts
|
||
*--------------------------------------
|
||
S.NextArgPtr1 lda ZPQuickPtr1
|
||
sec
|
||
adc (ZPQuickPtr1)
|
||
sta ZPQuickPtr1
|
||
bcc .8
|
||
inc ZPQuickPtr1+1
|
||
.8 rts
|
||
*--------------------------------------
|
||
S.GetArgA.Idx .BS 1
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE SYS/KERNEL.S.ARG
|
||
LOAD SYS/KERNEL.S
|
||
ASM
|