From 88736b1523e417008d033949d420da76a3085236 Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Thu, 25 Apr 2019 21:38:11 +0930 Subject: [PATCH] fix some bugs in pack_word routine --- c64/basic/pack_word.s | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/c64/basic/pack_word.s b/c64/basic/pack_word.s index 8d0a21df..2f9c660a 100644 --- a/c64/basic/pack_word.s +++ b/c64/basic/pack_word.s @@ -26,6 +26,12 @@ pack_word: ;; is incomplete, which is important for searching for abbreviated ;; key words.) + ;; Make sure we have a sane request + lda tokenise_work1 + bne + + sec + rts +* ;; Initialise internal variables lda #$00 sta tokenise_work2 @@ -213,9 +219,9 @@ get_packed_char_index: find_char_loop: cmp packed_message_chars,y bne not_a_match - +enumerate: ;; Is it a nybl abbreviable char? - cpy #13 + cpy #14 bcs not_nybl_char ;; Yes, so add 1 and return it iny @@ -230,7 +236,7 @@ not_nybl_char: ;; we need to add $E2 tya clc - adc #$E3 + adc #$E2 rts not_a_match: