(lz) Added summary ouput

This commit is contained in:
neauoire 2023-11-19 10:54:45 -08:00
parent a9b1a62ed6
commit 5ba6a002af
1 changed files with 32 additions and 2 deletions

View File

@ -40,8 +40,18 @@
;src <decode_ulz>
( | 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 <pstr>
;src <pstr>
;dict/spacer <pstr>
;dst <pstr>
[ LIT2 "( 18 ] DEO
.ptr LDZ2 ;mem SUB2 <pdec>
;dict/bytes <pstr>
[ LIT2 ") 18 ] DEO
#0a18 DEO
( halt ) #800f DEO
BRK
@ -98,12 +108,32 @@
;&b .File/read DEO2
[ LIT &b $1 ] JMP2r
@<pstr> ( str* -- )
&w LDAk #18 DEO
INC2 & LDAk ?&w
POP2 JMP2r
@<perr> ( str* -- )
&w LDAk #19 DEO
INC2 & LDAk ?&w
POP2 JMP2r
@<pdec> ( 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