2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*/--------------------------------------
|
2017-08-24 12:46:48 +00:00
|
|
|
|
* # GetArg.A
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In:
|
2016-10-25 06:58:15 +00:00
|
|
|
|
* A = argument index.
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out:
|
2016-10-24 15:54:43 +00:00
|
|
|
|
* CC : success
|
2017-08-24 06:47:31 +00:00
|
|
|
|
* Y,A = CStr To Arg[A]
|
2016-08-17 06:25:58 +00:00
|
|
|
|
* CS : Out Of Bound
|
2016-10-24 15:54:43 +00:00
|
|
|
|
*\--------------------------------------
|
2017-09-25 15:50:33 +00:00
|
|
|
|
K.GetArg.A pha save requested arg#
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
ldy #S.PS.hARGS
|
2016-08-17 06:25:58 +00:00
|
|
|
|
lda (pPs),y
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMemPtr.A
|
2017-09-25 15:50:33 +00:00
|
|
|
|
|
|
|
|
|
plx we want 0 ?
|
|
|
|
|
|
|
|
|
|
beq .80 yes, returns MemPtr
|
|
|
|
|
|
|
|
|
|
>STYA ZPPtr1 no, save it
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPPtr1) end of ARG[]
|
|
|
|
|
beq .9 yes, not found....
|
|
|
|
|
|
|
|
|
|
.3 inc ZPPtr1 skip next one....
|
|
|
|
|
bne .4
|
2017-08-24 06:47:31 +00:00
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
.4 lda (ZPPtr1)
|
|
|
|
|
bne .3
|
2017-08-24 06:47:31 +00:00
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
inc ZPPtr1 ....and point to next, or ending 0
|
|
|
|
|
bne .5
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr1+1
|
2017-09-25 15:50:33 +00:00
|
|
|
|
|
|
|
|
|
.5 dex
|
2017-09-28 15:39:12 +00:00
|
|
|
|
bne .1 stop here....
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr1) at end of ARGS[] ?
|
|
|
|
|
beq .9
|
2017-09-25 15:50:33 +00:00
|
|
|
|
|
|
|
|
|
.8 >LDYA ZPPtr1
|
|
|
|
|
.80 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
2016-08-17 06:25:58 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.ARG
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
2016-08-17 06:25:58 +00:00
|
|
|
|
ASM
|