mirror of
https://github.com/emmanuel-marty/lzsa.git
synced 2024-11-26 02:49:19 +00:00
smaller
This commit is contained in:
parent
d3d62c3bf0
commit
fb53706361
@ -37,8 +37,12 @@ DECODE_TOKEN
|
|||||||
|
|
||||||
AND #$70 ; isolate literals count
|
AND #$70 ; isolate literals count
|
||||||
BEQ NO_LITERALS ; skip if no literals to copy
|
BEQ NO_LITERALS ; skip if no literals to copy
|
||||||
CMP #$70 ; LITERALS_RUN_LEN?
|
LSR A ; shift literals count into place
|
||||||
BNE EMBEDDED_LITERALS ; if not, count is directly embedded in token
|
LSR A
|
||||||
|
LSR A
|
||||||
|
LSR A
|
||||||
|
CMP #$07 ; LITERALS_RUN_LEN?
|
||||||
|
BNE PREPARE_COPY_LITERALS ; if not, count is directly embedded in token
|
||||||
|
|
||||||
JSR GETSRC ; get extra byte of variable literals count
|
JSR GETSRC ; get extra byte of variable literals count
|
||||||
; the carry is always set by the CMP above
|
; the carry is always set by the CMP above
|
||||||
@ -55,14 +59,7 @@ LARGE_VARLEN_LITERALS ; handle 16 bits literals count
|
|||||||
; literals count = directly these 16 bits
|
; literals count = directly these 16 bits
|
||||||
JSR GETLARGESRC ; grab low 8 bits in X, high 8 bits in A
|
JSR GETLARGESRC ; grab low 8 bits in X, high 8 bits in A
|
||||||
TAY ; put high 8 bits in Y
|
TAY ; put high 8 bits in Y
|
||||||
BCS PREPARE_COPY_LITERALS_HIGH ; (*like JMP PREPARE_COPY_LITERALS_HIGH but shorter)
|
.DB $A9 ; mask TAX (faster than BCS)
|
||||||
|
|
||||||
EMBEDDED_LITERALS
|
|
||||||
LSR A ; shift literals count into place
|
|
||||||
LSR A
|
|
||||||
LSR A
|
|
||||||
LSR A
|
|
||||||
|
|
||||||
PREPARE_COPY_LITERALS
|
PREPARE_COPY_LITERALS
|
||||||
TAX
|
TAX
|
||||||
PREPARE_COPY_LITERALS_HIGH
|
PREPARE_COPY_LITERALS_HIGH
|
||||||
|
Loading…
Reference in New Issue
Block a user