Housekeeping
This commit is contained in:
parent
3730f98dc4
commit
4f257170f4
|
@ -1,37 +1,30 @@
|
|||
( decompressor )
|
||||
( ulz decoder )
|
||||
|
||||
|10 @Console &vector $2 &read $1 &pad $5 &write $1 &err $1
|
||||
|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
|
||||
|
||||
|0000
|
||||
|
||||
@src $30
|
||||
@dst $30
|
||||
@ptr $1
|
||||
|00 @src $30 @dst $30 @ptr $1
|
||||
|
||||
|0100
|
||||
|
||||
@ready-src ( -> ) ;&await .Console/vector DEO2 BRK
|
||||
&await ( -> ) .Console/read DEI .src skey ?ready-dst BRK
|
||||
@ready-dst ( -> ) ;&await .Console/vector DEO2 BRK
|
||||
&await ( -> ) .Console/read DEI .dst skey ?on-ready BRK
|
||||
|
||||
@on-ready ( -> )
|
||||
|
||||
;src decode_ulz
|
||||
( ;mem pstr #0a18 DEO )
|
||||
( debug #800e DEO )
|
||||
( write )
|
||||
( export )
|
||||
;dst .File/name DEO2
|
||||
;mem .ptr LDZ2 SUB2 .File/length DEO2
|
||||
;mem .File/write DEO2
|
||||
;mem
|
||||
DUP2 .ptr LDZ2 SUB2 .File/length DEO2
|
||||
.File/write DEO2
|
||||
( halt ) #800f DEO
|
||||
|
||||
BRK
|
||||
BRK
|
||||
|
||||
@decode_ulz ( str* -- )
|
||||
;mem .ptr STZ2
|
||||
.File/name DEO2
|
||||
&stream
|
||||
&stream ( -- )
|
||||
#0001 .File/length DEO2
|
||||
;&b
|
||||
DUP2 .File/read DEO2
|
||||
|
@ -76,8 +69,8 @@ JMP2r
|
|||
@|stdlib )
|
||||
|
||||
@skey ( key buf -- proc ) OVR #21 LTH ?&eval #00 SWP sput #00 JMP2r &eval POP2 #01 JMP2r
|
||||
@scap ( str* -- end* ) LDAk ?&w JMP2r &w INC2 LDAk ?&w JMP2r
|
||||
@sput ( chr str* -- ) scap INC2k #00 ROT ROT STA STA JMP2r
|
||||
@scap ( str* -- end* ) &w INC2 & LDAk ?&w JMP2r
|
||||
@sput ( chr str* -- ) scap/ INC2k #00 ROT ROT STA STA JMP2r
|
||||
@getc ( -- b ) #0001 .File/length DEO2 ;&b .File/read DEO2 [ LIT &b $1 ] JMP2r
|
||||
|
||||
@mem
|
||||
|
|
Loading…
Reference in New Issue