A2osX/SYS/KERNEL.S.ARG.txt

42 lines
780 B
Plaintext
Raw Normal View History

2017-12-22 21:24:30 +00:00
NEW
2019-05-25 19:24:07 +00:00
AUTO 3,1
*/--------------------------------------
2018-10-16 15:48:03 +00:00
* # ArgV
2018-06-18 06:22:50 +00:00
* ## ASM
2018-06-14 15:31:36 +00:00
* **In:**
* A = argument index.
2018-10-11 15:23:06 +00:00
* ## RETURN VALUE
2018-06-14 15:31:36 +00:00
* CC : success
* Y,A = PTR To Arg[A]
* CS : Out Of Bound
*\--------------------------------------
2018-10-18 15:32:57 +00:00
K.ArgV tax save requested arg#
2018-10-16 15:48:03 +00:00
ldy #S.PS.hARGV
2016-08-17 06:25:58 +00:00
lda (pPs),y
2018-06-21 15:12:10 +00:00
jsr K.GetMemPtr
2019-09-10 10:22:57 +00:00
>STYA ZPPtr2 Use Ptr2, called from ExpandStr
.1 lda (ZPPtr2) end of ARGV[] ?
2018-10-18 15:32:57 +00:00
beq .9 yes, not found....
2018-10-18 15:32:57 +00:00
dex
bmi .7
2019-09-10 10:22:57 +00:00
.3 jsr SHARED.GetCharPtr2 skip str
bne .3
2019-09-10 10:22:57 +00:00
jsr SHARED.NextCharPtr2 skip \0
2018-10-18 15:32:57 +00:00
bra .1
2019-09-10 10:22:57 +00:00
.7 >LDYA ZPPtr2
2018-06-14 15:31:36 +00:00
.8 clc
rts
2019-02-19 16:34:43 +00:00
.9 lda #E.OOB
sec
rts
2016-08-17 06:25:58 +00:00
*--------------------------------------
MAN
2018-11-17 17:17:13 +00:00
SAVE USR/SRC/SYS/KERNEL.S.ARG
LOAD USR/SRC/SYS/KERNEL.S
2016-08-17 06:25:58 +00:00
ASM