59 lines
1.1 KiB
Tal
59 lines
1.1 KiB
Tal
|
|10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1
|
||
|
|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
|
||
|
|000
|
||
|
|
||
|
@src $40
|
||
|
|
||
|
|100
|
||
|
|
||
|
@on-reset ( -> )
|
||
|
;meta #06 DEO2
|
||
|
;await-src .Console/vector DEO2
|
||
|
.Console/type DEI ?{ ;dict/usage <pstr>
|
||
|
#000f DEO }
|
||
|
BRK
|
||
|
|
||
|
@meta $1
|
||
|
( name ) "Uxndis 0a
|
||
|
( desc ) "Uxntal 20 "Disassembler 0a
|
||
|
( auth ) "By 20 "Devine 20 "Lu 20 "Linvega 0a
|
||
|
( date ) "9 20 "Jun 20 "2024 $2
|
||
|
|
||
|
@await-src ( -> )
|
||
|
[ LIT2 04 -Console/type ] DEI NEQ ?{ <dis>
|
||
|
#800f DEO
|
||
|
BRK }
|
||
|
.Console/read DEI [ LIT &ptr -src ] INCk ,&ptr STR
|
||
|
STZ
|
||
|
BRK
|
||
|
|
||
|
@<dis> ( -- )
|
||
|
;src <pstr> #0a18 DEO
|
||
|
JMP2r
|
||
|
|
||
|
(
|
||
|
@|stdlib )
|
||
|
|
||
|
@<phex> ( short* -: )
|
||
|
SWP /b
|
||
|
&b ( byte -: )
|
||
|
DUP #04 SFT /c
|
||
|
&c ( byte -: )
|
||
|
#0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO
|
||
|
JMP2r
|
||
|
|
||
|
@<pstr> ( str* -- )
|
||
|
LDAk #18 DEO
|
||
|
INC2 LDAk ?<pstr>
|
||
|
POP2 JMP2r
|
||
|
|
||
|
@opcodes [
|
||
|
"LIT "INC "POP "NIP "SWP "ROT "DUP "OVR
|
||
|
"EQU "NEQ "GTH "LTH "JMP "JCN "JSR "STH
|
||
|
"LDZ "STZ "LDR "STR "LDA "STA "DEI "DEO
|
||
|
"ADD "SUB "MUL "DIV "AND "ORA "EOR "SFT
|
||
|
&brk "BRK ]
|
||
|
|
||
|
@dict &usage "usage: 20 "uxndis.rom 20 "input.rom 0a $1
|
||
|
|