diff --git a/cli/lz/a.ulz b/cli/lz/a.ulz new file mode 100644 index 0000000..0a7829b Binary files /dev/null and b/cli/lz/a.ulz differ diff --git a/cli/lz/b.bin b/cli/lz/b.bin new file mode 100644 index 0000000..04e8312 Binary files /dev/null and b/cli/lz/b.bin differ diff --git a/cli/lz/ulzdec b/cli/lz/ulzdec new file mode 100755 index 0000000..b2c3c3b Binary files /dev/null and b/cli/lz/ulzdec differ diff --git a/cli/lz/ulzenc b/cli/lz/ulzenc new file mode 100755 index 0000000..0057354 Binary files /dev/null and b/cli/lz/ulzenc differ diff --git a/cli/lz/ulzenc.tal b/cli/lz/ulzenc.tal index 2aa680d..403e641 100644 --- a/cli/lz/ulzenc.tal +++ b/cli/lz/ulzenc.tal @@ -9,6 +9,12 @@ @dst $30 @ptr $1 @match-len $2 + @output-ptr $2 + @match-ctl $2 + @dict-best $2 + @combine $2 + @dict $2 + @dict-len $2 |0100 @@ -84,13 +90,13 @@ &w ( -- ) ( | get available dictionary size ) DUP2 ;raw SUB2 #0100 LTH2k ?{ SWP2 } - POP2 ,&dict-len STR2 + POP2 .dict-len STZ2 ( | size of the string to search for ) SUB2k #3fff #0004 ADD2 LTH2k ?{ SWP2 } POP2 ,&string-len STR2 ( | itterate through the dictionary ) #0000 .match-len STZ2 - [ LIT2 &dict-len $2 ] SUB2k .dict STZ2 + .dict-len LDZ2 SUB2k .dict STZ2 ( | create a few inlines ) DUP2 ,&in STR2 &for1 ( dict-len != 0 ) @@ -105,7 +111,7 @@ ( Dictionary repeats if we hit the end ) ( in[i] != dict[i % dict_len] break; ) DUP2 [ LIT2 &in $2 ] ADD2 LDA2 - OVR2 ,&dict-len LDR2 DIV2k MUL2 SUB2 + OVR2 .dict-len LDZ2 DIV2k MUL2 SUB2 .dict LDZ2 ADD2 LDA2 NEQ2 ?&end INC2 ORAk ?&for2 &end