maximum keyword length is not 16 bytes

This commit is contained in:
FeralChild64 committed 2020-06-24 15:54:30 +02:00
1 parent 74284d39b8
commit fdf4b1cc1d
4 files changed
+13 -10

No files matched your search

+9 -7
View File
@@ -29,16 +29,16 @@ tk_pack:
// Reuse the CPU stack - addresses below $102 are used by 'tokenise_line.s'
.label tk__len_unpacked = $103 // length of unpacked data; it could replace 'tk__nibble_flag', but at the cost of code size/performance
.label tk__shorten_bits = $104 // for quick shortening of packed candidate
.label tk__nibble_flag = $105 // $00 = start from new byte, $FF = start from high nibble
.label tk__byte_offset = $106 // offset of the current byte (to place new data) in tk__packed
.label tk__shorten_bits = $104 // 2 bytes for quick shortening of packed candidate
.label tk__nibble_flag = $106 // $00 = start from new byte, $FF = start from high nibble
.label tk__byte_offset = $107 // offset of the current byte (to place new data) in tk__packed
.label tk__packed = $107 // packed candidate, 13 bytes is enough for worst case - 8 byte keyword
.label tk__packed = $108 // packed candidate, 13 bytes is enough for worst case - 8 byte keyword
// Initialize variables
lda #$00
ldy #(tk__packed - tk__len_unpacked + 13) // XXX maybe do not clear that much, just put 0 at the end while compressing
ldy #(tk__packed - tk__len_unpacked + 14) // XXX maybe do not clear that much, just put 0 at the end while compressing
!:
sta tk__len_unpacked, y
dey
@@ -126,7 +126,8 @@ tk_pack_1n_done:
// Put the bit mark - to indicate 1-nibble encoding
clc
ror tk__shorten_bits
ror tk__shorten_bits+0
ror tk__shorten_bits+1
// FALLTROUGH
@@ -193,7 +194,8 @@ tk_pack_3n_done:
// Put the bit mark - to indicate 3-nibble encoding
sec
ror tk__shorten_bits
ror tk__shorten_bits+0
ror tk__shorten_bits+1
bcc tk_pack_loop_next // branch always