maximum keyword length is not 16 bytes
This commit is contained in:
1 parent
74284d39b8
commit
fdf4b1cc1d
4 files changed
+13
-10
No files matched your search
@@ -143,4 +143,4 @@
|
|||||||
|
|
||||||
// Other
|
// Other
|
||||||
|
|
||||||
#define CONFIG_COMPRESSION_LVL_2 // work on this option stopped - it would not give any improvement
|
// #define CONFIG_COMPRESSION_LVL_2 // work on this option stopped - it would not give any improvement
|
||||||
@@ -29,16 +29,16 @@ tk_pack:
|
|||||||
// Reuse the CPU stack - addresses below $102 are used by 'tokenise_line.s'
|
// 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__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__shorten_bits = $104 // 2 bytes for quick shortening of packed candidate
|
||||||
.label tk__nibble_flag = $105 // $00 = start from new byte, $FF = start from high nibble
|
.label tk__nibble_flag = $106 // $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__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
|
// Initialize variables
|
||||||
|
|
||||||
lda #$00
|
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
|
sta tk__len_unpacked, y
|
||||||
dey
|
dey
|
||||||
@@ -126,7 +126,8 @@ tk_pack_1n_done:
|
|||||||
// Put the bit mark - to indicate 1-nibble encoding
|
// Put the bit mark - to indicate 1-nibble encoding
|
||||||
|
|
||||||
clc
|
clc
|
||||||
ror tk__shorten_bits
|
ror tk__shorten_bits+0
|
||||||
|
ror tk__shorten_bits+1
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
|
|
||||||
@@ -193,7 +194,8 @@ tk_pack_3n_done:
|
|||||||
// Put the bit mark - to indicate 3-nibble encoding
|
// Put the bit mark - to indicate 3-nibble encoding
|
||||||
|
|
||||||
sec
|
sec
|
||||||
ror tk__shorten_bits
|
ror tk__shorten_bits+0
|
||||||
|
ror tk__shorten_bits+1
|
||||||
|
|
||||||
bcc tk_pack_loop_next // branch always
|
bcc tk_pack_loop_next // branch always
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ tk_shorten:
|
|||||||
|
|
||||||
// Now check if the last character was encoded as 1 nibble or 3 nibbles
|
// Now check if the last character was encoded as 1 nibble or 3 nibbles
|
||||||
|
|
||||||
asl tk__nibble_flag
|
asl tk__shorten_bits+1
|
||||||
|
rol tk__shorten_bits+0
|
||||||
bcs tk_shorten_3n
|
bcs tk_shorten_3n
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
|
|||||||
@@ -1034,7 +1034,7 @@ void DataSet::validateLists()
|
|||||||
// Check mor maximum keyword length
|
// Check mor maximum keyword length
|
||||||
if (stringEntryList.type == ListType::KEYWORDS)
|
if (stringEntryList.type == ListType::KEYWORDS)
|
||||||
{
|
{
|
||||||
if (stringEntry.string.length() > 8) ERROR("keyword cannot be longer than 8 characters");
|
if (stringEntry.string.length() > 16) ERROR("keyword cannot be longer than 16 characters");
|
||||||
tk__max_keyword_len = std::max(tk__max_keyword_len, (uint8_t) stringEntry.string.length());
|
tk__max_keyword_len = std::max(tk__max_keyword_len, (uint8_t) stringEntry.string.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user