uxn/projects/software/asma.tal

49 lines
1010 B
Tal
Raw Normal View History

( 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 &offset-hs $2 &offset-ls $2 &name $2 &length $2 &load $2 &save $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 ( )
;asma-heap #0000 ;asma-assemble-file JSR2
#01 .System/halt DEO
BRK
include projects/library/asma.tal
@asma-heap
|e000 &end
@asma-read-buffer
|f800 &end
@asma-write-buffer
|ffff &end