(lz) Added append short

This commit is contained in:
neauoire 2023-11-19 11:30:17 -08:00
parent 6a3ca87e97
commit 7485fc7e2c
1 changed files with 6 additions and 2 deletions

View File

@ -70,6 +70,11 @@
STA
JMP2r
@<append-short> ( short* -- )
.output-ptr LDZ2 INC2k INC2 .output-ptr STZ2
STA2
JMP2r
@uxn_lz_compress ( input* length* -- )
( | fill variables )
;compressed .output-ptr STZ2
@ -125,8 +130,7 @@
NIP #80 ORA <append-byte>
!&cpy-resume
&cpy2 ( match-ctl* -- )
SWP #c0 ORA <append-byte>
<append-byte>
SWP #c0 ORA <append-short>
&cpy-resume ( -- )
( | *output_ptr++ = in - dict_best - 1; )
DUP2 .dict-best LDZ2 SUB2 #0001 SUB2 NIP <append-byte>