fix some bugs in pack_word routine

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-25 21:38:11 +09:30
1 parent e5892b6a3d
commit 88736b1523
1 file changed
+9 -3
+9 -3
View File
@@ -26,6 +26,12 @@ pack_word:
;; is incomplete, which is important for searching for abbreviated ;; is incomplete, which is important for searching for abbreviated
;; key words.) ;; key words.)
;; Make sure we have a sane request
lda tokenise_work1
bne +
sec
rts
*
;; Initialise internal variables ;; Initialise internal variables
lda #$00 lda #$00
sta tokenise_work2 sta tokenise_work2
@@ -213,9 +219,9 @@ get_packed_char_index:
find_char_loop: find_char_loop:
cmp packed_message_chars,y cmp packed_message_chars,y
bne not_a_match bne not_a_match
enumerate:
;; Is it a nybl abbreviable char? ;; Is it a nybl abbreviable char?
cpy #13 cpy #14
bcs not_nybl_char bcs not_nybl_char
;; Yes, so add 1 and return it ;; Yes, so add 1 and return it
iny iny
@@ -230,7 +236,7 @@ not_nybl_char:
;; we need to add $E2 ;; we need to add $E2
tya tya
clc clc
adc #$E3 adc #$E2
rts rts
not_a_match: not_a_match: