A2osX/SYS/KERNEL.S.ARG.txt
2020-01-09 16:54:14 +01:00

42 lines
780 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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