diff options
| author | kitty <nepeta@canaglie.net> | 2026-02-26 16:10:36 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-02-26 16:10:36 +1100 |
| commit | e3b77b76497fe3f59867d426bd3a7b1ceaee3245 (patch) | |
| tree | feea0be85be910318966c545018d700331a8b31a /jefs.s | |
| parent | b4407f08583b8c59db5430f5c4cda1a8a355e09a (diff) | |
add end of input handling to cparse
Diffstat (limited to 'jefs.s')
| -rw-r--r-- | jefs.s | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -275,9 +275,13 @@ defword "cparse", cparse, 0 pspop r15 ; c mov r13, qword [to_in] add r13, qword [tib] + mov r10, qword [tib] + add r10, qword [num_tib] mov r12b, byte [r13] .wordloop_start: + cmp r13, r10 + jge .empty push r13 ; keep start address of this word for later mov r11, 1 ; W: word length count .wordloop: @@ -286,6 +290,8 @@ defword "cparse", cparse, 0 inc r11 inc r13 + cmp r13, r10 + jge .empty mov r12b, byte [r13] jmp .wordloop @@ -298,6 +304,12 @@ defword "cparse", cparse, 0 pspush r11 ; u ret +.empty: + xor r13, r13 + pspush r13 + pspush r13 + ret + defword "find", find, 0 pspop r10 ; u pspop r11 ; c-addr |
