mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-29 17:50:18 +00:00
42 lines
780 B
Plaintext
42 lines
780 B
Plaintext
NEW
|
||
AUTO 3,1
|
||
*/--------------------------------------
|
||
* # ArgV
|
||
* ## ASM
|
||
* **In:**
|
||
* A = argument index.
|
||
* ## RETURN VALUE
|
||
* CC : success
|
||
* Y,A = PTR To Arg[A]
|
||
* CS : Out Of Bound
|
||
*\--------------------------------------
|
||
K.ArgV tax save requested arg#
|
||
ldy #S.PS.hARGV
|
||
lda (pPs),y
|
||
jsr K.GetMemPtr
|
||
|
||
>STYA ZPPtr2 Use Ptr2, called from ExpandStr
|
||
.1 lda (ZPPtr2) end of ARGV[] ?
|
||
|
||
beq .9 yes, not found....
|
||
dex
|
||
bmi .7
|
||
.3 jsr SHARED.GetCharPtr2 skip str
|
||
bne .3
|
||
|
||
jsr SHARED.NextCharPtr2 skip \0
|
||
bra .1
|
||
|
||
.7 >LDYA ZPPtr2
|
||
.8 clc
|
||
rts
|
||
|
||
.9 lda #E.OOB
|
||
sec
|
||
rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE USR/SRC/SYS/KERNEL.S.ARG
|
||
LOAD USR/SRC/SYS/KERNEL.S
|
||
ASM
|