uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

asma.tal (1090B)


      1 ( devices )
      2 
      3 |00 @System     [ &vector $2 &wst  $1 &rst    $1 &pad   $4 &r $2 &g $2 &b $2   &debug $1 &halt $1 ]
      4 |10 @Console    [ &vector $2 &read $1 &pad    $5 &write $1 &error  $1 ]
      5 |a0 @File       [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 ]
      6 
      7 ( vectors )
      8 
      9 |0100 @reset
     10 	(
     11 		Set the log level for helping to debug stuff.
     12 		Its value is the bitwise OR of all the following output types:
     13 			#01 prints the number of lines in the source code,
     14 			#04 dumps all defined labels at end, and
     15 			#08 prints the heap usage.
     16 	)
     17 	#09 ;asma/log-level STA
     18 
     19 	;asma-heap ;heap STA2
     20 
     21 	;on-input .Console/vector DEO2
     22 	BRK
     23 
     24 @on-input ( -> )
     25 	.Console/read DEI
     26 	DUP #0a EQU ,&newline JCN
     27 	;append-heap-byte JSR2
     28 	BRK
     29 
     30 	&newline ( 0a )
     31 	DUP EOR ( 00 )
     32 	;append-heap-byte JSR2 ( )
     33 
     34 	,&output-file LDR2 ORA ,&run JCN
     35 	;heap LDA2 ,&output-file STR2
     36 	BRK
     37 
     38 	&run
     39 	;asma-heap LIT2 &output-file $2 ;asma-assemble-file JSR2
     40 	#80 .System/halt DEO
     41 	BRK
     42 
     43 ~projects/library/asma.tal
     44 
     45 @asma-heap
     46 |e000 &end
     47 
     48 @asma-read-buffer
     49 |f800 &end
     50 
     51 @asma-write-buffer
     52 |ffff &end
     53