Print size

This commit is contained in:
neauoire 2023-08-06 09:39:40 -07:00
parent 830dfe3e1b
commit 8122716482
1 changed files with 30 additions and 20 deletions

View File

@ -10,10 +10,10 @@
|0100 |0100
@on-reset ( -> ) @on-reset ( -> )
.Console/type DEI ?&>has-arg .Console/type DEI ?{
;Dict/usage <perr> ;Dict/usage <perr>/
#010f DEO #010f DEO
BRK &>has-arg BRK }
;await-src .Console/vector DEO2 ;await-src .Console/vector DEO2
BRK BRK
@ -24,44 +24,45 @@
@on-ready ( -> ) @on-ready ( -> )
;src .File/name DEO2 ;src .File/name DEO2
#0001 .File/length DEO2 #0001 .File/length DEO2
#00 #0a19 DEO
#0000
&stream ( -- ) &stream ( -- )
;&b .File/read DEO2 ;&b .File/read DEO2
.File/success DEI2 #0000 EQU2 ?&eof .File/success DEI2 #0000 EQU2 ?&eof
[ LIT &b $1 ] <phex>/b [ LIT &b $1 ] <phex>/b
INC DUP <print-spacer> INC2 DUP <print-spacer>
!&stream !&stream
&eof ( id -- ) &eof ( id -- )
POP #0a18 DEO #0a19 DEOk DEO
<pdec>
;Dict/bytes <perr>
;src <perr>
#0a19 DEO
#800f DEO #800f DEO
BRK BRK
@<print-spacer> ( id -- ) @<print-spacer> ( id -- )
DUP #0f AND ?&>no-lb DUP #0f AND ?{
POP #0a18 DEO POP #0a18 DEO
JMP2r &>no-lb JMP2r }
#01 AND ?&>end #01 AND ?{ #2018 DEO }
#2018 DEO &>end
JMP2r JMP2r
( (
@|stdlib ) @|stdlib )
@skey ( key buf -- proc ) @skey ( key buf -- proc )
OVR #21 LTH ?&eval OVR #21 LTH ?{
#00 SWP sput #00 JMP2r #00 SWP sput #00 JMP2r }
&eval ( -- )
POP2 #01 JMP2r POP2 #01 JMP2r
@scap ( str* -- end* ) @scap ( str* -- end* )
!&a
&w ( -- ) &w ( -- )
INC2 &a LDAk ?&w INC2 & LDAk ?&w
JMP2r JMP2r
@sput ( chr str* -- ) @sput ( chr str* -- )
scap INC2k #00 ROT ROT STA scap/ ROT #00 SWP2 STA2
STA
JMP2r JMP2r
@<phex> ( short* -- ) @<phex> ( short* -- )
@ -73,14 +74,23 @@
JMP2r JMP2r
@<perr> ( err* -- ) @<perr> ( err* -- )
!&a
&w ( -- ) &w ( -- )
LDAk #19 DEO LDAk #19 DEO
INC2 &a LDAk ?&w INC2 & LDAk ?&w
POP2 JMP2r 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
( (
@|res ) @|res )
@Dict &usage "usage: 20 "hx.rom 20 "input.bin 0a $1 @Dict &usage "usage: 20 "hx.rom 20 "input.bin 0a $1
&bytes 20 "bytes 20 "in 20 $1