mirror of https://git.sr.ht/~rabbits/uxn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
497 B
31 lines
497 B
( hexes |
|
|
|
A small utility that prints incoming console messages as hex values. ) |
|
|
|
%RTN { JMP2r } |
|
|
|
|10 @Console [ &vector $2 &read $1 &pad $5 &write $1 ] |
|
|
|
( init ) |
|
|
|
|0100 ( -> ) |
|
|
|
;on-message .Console/vector DEO2 |
|
|
|
BRK |
|
|
|
@on-message ( -> ) |
|
|
|
.Console/read DEI ,print-hex JSR |
|
|
|
BRK |
|
|
|
@print-hex ( value -- ) |
|
|
|
STHk #04 SFT ,&parse JSR .Console/write DEO |
|
STHr #0f AND ,&parse JSR .Console/write DEO |
|
RTN |
|
&parse ( value -- char ) |
|
DUP #09 GTH ,&above JCN #30 ADD RTN &above #09 SUB #60 ADD RTN |
|
|
|
RTN
|
|
|