Skip to content

Commit

Permalink
Forth: Add @ ! , shortcuts in FIND
Browse files Browse the repository at this point in the history
  • Loading branch information
adumont committed Jan 22, 2022
1 parent d7d4c0f commit 0b5171c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions forth.s
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,33 @@ defword "FIND",,
STA 5,X
JMP do_DROP
@not_semi:
CMP #'@'
BNE @not_fetch
; word is "@"
LDA #<h_FETCH
STA 4,X
LDA #>h_FETCH
STA 5,X
JMP do_DROP
@not_fetch:
CMP #'!'
BNE @not_store
; word is "!"
LDA #<h_STORE
STA 4,X
LDA #>h_STORE
STA 5,X
JMP do_DROP
@not_store:
CMP #','
BNE @not_comma
; word is ","
LDA #<h_COMMA
STA 4,X
LDA #>h_COMMA
STA 5,X
JMP do_DROP
@not_comma:
@nxt_word:
; store W+2 in G1 (G1 points to the counted str)
CLC
Expand Down

0 comments on commit 0b5171c

Please sign in to comment.