REM = $8f ; BASIC token-code
NAME_LEN = 16 ; Maximum length of command-name
-; Get possible command-line arguments. Goes into the special INIT segment,
+; Get possible command-line arguments. Goes into the special ONCE segment,
; which may be reused after the startup code is run
-.segment "INIT"
+.segment "ONCE"
initmainargs:
inx
cmp term
bne argloop
-
+
; We've found the end of the argument. X points one character behind it, and
; A contains the terminating character. To make the argument a valid C string,
; replace the terminating character by a zero.
stx __argv + 1
rts
-.segment "INITBSS"
+.segment "INIT"
term: .res 1
name: .res NAME_LEN + 1