diff --git a/cli/lz/ulzdec.tal b/cli/lz/ulzdec.tal index e1f9dff..d284de1 100644 --- a/cli/lz/ulzdec.tal +++ b/cli/lz/ulzdec.tal @@ -40,8 +40,18 @@ ;src ( | export ) ;dst .File/name DEO2 - ;mem DUP2 .ptr LDZ2 SUB2 .File/length DEO2 - .File/write DEO2 + .ptr LDZ2 ;mem SUB2 .File/length DEO2 + ;mem .File/write DEO2 + ( | summary ) + ;dict/decompressed + ;src + ;dict/spacer + ;dst + [ LIT2 "( 18 ] DEO + .ptr LDZ2 ;mem SUB2 + ;dict/bytes + [ LIT2 ") 18 ] DEO + #0a18 DEO ( halt ) #800f DEO BRK @@ -98,12 +108,32 @@ ;&b .File/read DEO2 [ LIT &b $1 ] JMP2r +@ ( str* -- ) + &w LDAk #18 DEO + INC2 & LDAk ?&w + POP2 JMP2r + @ ( str* -- ) &w LDAk #19 DEO INC2 & LDAk ?&w POP2 JMP2r +@ ( short* -- ) + #2710 [ LIT2r 00fb ] + &w ( -- ) + DIV2k #000a DIV2k MUL2 SUB2 SWPr EQUk OVR STHkr EQU AND ?{ + DUP [ LIT "0 ] ADD #19 DEO + INCr } + POP2 #000a DIV2 SWPr INCr STHkr ?&w + POP2r POP2 POP2 JMP2r + +( +@| mem ) + @dict &usage "usage: 20 "ulzdec.rom 20 "a.bin 20 "b.ulz 0a $1 + &decompressed "Decompressed 20 $1 + &spacer 20 "-> 20 $1 + &bytes 20 "bytes $1 @mem