0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-08 23:35:05 +00:00
uxn/projects/software/asma.tal
Andrew Alderwick d053d0c97f Bugfix to asma.
2021-11-19 00:22:35 +00:00

53 lines
1.1 KiB
Tal

( devices )
|00 @System [ &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1 ]
|10 @Console [ &vector $2 &read $1 &pad $5 &write $1 &error $1 ]
|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 ]
( vectors )
|0100 @reset
(
Set the log level for helping to debug stuff.
Its value is the bitwise OR of all the following output types:
#01 prints the number of lines in the source code,
#04 dumps all defined labels at end, and
#08 prints the heap usage.
)
#09 ;asma/log-level STA
;asma-heap ;heap STA2
;on-input .Console/vector DEO2
BRK
@on-input ( -> )
.Console/read DEI
DUP #0a EQU ,&newline JCN
;append-heap-byte JSR2
BRK
&newline ( 0a )
DUP EOR ( 00 )
;append-heap-byte JSR2 ( )
,&output-file LDR2 ORA ,&run JCN
;heap LDA2 ,&output-file STR2
BRK
&run
;asma-heap LIT2 &output-file $2 ;asma-assemble-file JSR2
#01 .System/halt DEO
BRK
~projects/library/asma.tal
@asma-heap
|e000 &end
@asma-read-buffer
|f800 &end
@asma-write-buffer
|ffff &end