Starting uxndis

This commit is contained in:
Devine Lu Linvega 2024-06-09 15:27:36 -08:00
parent 4f273fb926
commit fa52bd7eba
2 changed files with 88 additions and 0 deletions

30
cli/uxndis/makefile Normal file
View File

@ -0,0 +1,30 @@
ID=uxndis
DIR=~/roms
ASM=uxncli ${DIR}/drifblim.rom
LIN=uxncli ${DIR}/uxnlin.rom
BAL=uxncli ${DIR}/uxnbal.rom
EMU=uxncli
ROM=bin/${ID}.rom
all: ${ROM}
lint:
@ ${LIN} src/${ID}.tal
bal:
@ ${BAL} src/${ID}.tal
run: all
@ ${EMU} ${ROM} etc/example.tal
clean:
@ rm -f ${ROM} ${ROM}.sym
install: all
@ cp ${ROM} ${DIR}
uninstall:
@ rm -f ${DIR}/${ID}.rom
archive: all
@ cp src/${ID}.tal ../oscean/etc/${ID}.tal.txt
.PHONY: all clean lint run install uninstall archive
${ROM}: src/${ID}.tal
@ mkdir -p bin && ${ASM} src/${ID}.tal ${ROM}

58
cli/uxndis/src/uxndis.tal Normal file
View File

@ -0,0 +1,58 @@
|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