mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2024-11-05 17:04:40 +00:00
Command line parsing fixes.
This commit is contained in:
parent
22a33d9673
commit
0ed16ad952
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
27
auxmem.s
27
auxmem.s
@ -1274,6 +1274,8 @@ STRCMP LDY #$00
|
||||
BEQ :MATCH
|
||||
CMP #' '
|
||||
BEQ :MATCH
|
||||
CMP #'"'
|
||||
BEQ :MATCH
|
||||
BRA :MISMTCH
|
||||
:MATCH CLC
|
||||
RTS
|
||||
@ -1360,29 +1362,36 @@ PRONEENT TAX
|
||||
:S2 JSR OSNEWL
|
||||
:EXIT RTS
|
||||
|
||||
* Consume spaces in command line
|
||||
* Consume spaces in command line. Treat " as space!
|
||||
* Return C set if no space found, C clear otherwise
|
||||
* Command line pointer in (ZP1),Y
|
||||
EATSPC LDA (ZP1),Y ; Check first char is space
|
||||
CMP #' '
|
||||
BNE :NOTFND
|
||||
INY
|
||||
:L1 LDA (ZP1),Y ; Eat any additional spaces
|
||||
CMP #' '
|
||||
EATSPC LDA (ZP1),Y ; Check first char is ...
|
||||
CMP #' ' ; ... space
|
||||
BEQ :START
|
||||
CMP #'"' ; Or quote mark
|
||||
BEQ :START
|
||||
BRA :NOTFND
|
||||
:START INY
|
||||
:L1 LDA (ZP1),Y ; Eat any additional ...
|
||||
CMP #' ' ; ... spaces
|
||||
BEQ :CONT
|
||||
CMP #'"' ; Or quote marks
|
||||
BNE :DONE
|
||||
INY
|
||||
:CONT INY
|
||||
BRA :L1
|
||||
:DONE CLC
|
||||
RTS
|
||||
:NOTFND SEC
|
||||
RTS
|
||||
|
||||
* Consume non-spaces in command line
|
||||
* Consume chars in command line until space or " is found
|
||||
* Command line pointer in (ZP1),Y
|
||||
* Returns with carry set if EOL
|
||||
EATWORD LDA (ZP1),Y
|
||||
CMP #' '
|
||||
BEQ :SPC
|
||||
CMP #'"'
|
||||
BEQ :SPC
|
||||
CMP #$0D ; Carriage return
|
||||
BEQ :EOL
|
||||
INY
|
||||
|
Loading…
Reference in New Issue
Block a user