uxnlin/etc/example.tal

115 lines
1.2 KiB
Tal

( comment )
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|0000
( program )
|0100 ( -> )
( testing: statics )
#0001 #0003 ADD2
( testing: unkeep )
DUP LDA
( testing: shorthand NIP )
SWP POP
( testing: shorthand INC )
#01 ADD
( testing: shorthand INC INC )
#02 ADD
( testing: shorthand POP2 )
POP POP
( testing: Mute )
[ #0001 ADD2 ]
( testing: redundant )
SWP2 SWP2
STH STHr
DUP POP
( testing: shift MUL/DIV )
#04 DIV
( unsafe )
#0104 ORA JMP
( DUP waste )
DUP #00 SWP
DUP2 #0000 SWP2
( unstashed )
#01 STH
#0001 STH2
.test STH
;test STH2
ADD STH ( should not trigger error )
( literal sequence )
#12 #12
#1234 #1234
( series of 3 )
DUP2 #0000 EQU2
( labels )
;label ;label
.label .label
( slow stack 2->1 )
STH2r ADD
STH2 ADDr
( slow stacks )
LDZ STH
LDZ2 STH2
DEI STH
DEI2 STH2
( catch as static )
#0102 ADD
( redundant keep )
STZk POP2
( do not catch )
[ LIT &test $1 ] #00 EQU
BRK
#1234 ( dead region )
!label ( fall-through )
@label
label-name ( tail-call )
JMP2r
( bad unkept )
DUP2 ADD
DUP2k EOR2
( slow literals )
LIT ". DUP
#02 DUP
.test DUP
( redundance )
#12 LDZ2 POP
#12 LDZ2 NIP
( nested )
[ [ ]
~etc/include.tal