2017-12-21 13:52:30 +00:00
|
|
|
; call tests
|
|
|
|
|
|
|
|
;output
|
|
|
|
|
|
|
|
|
|
|
|
~ foo {
|
|
|
|
|
|
|
|
var .word var1 = 99
|
|
|
|
memory .word mem1 = $cff0
|
|
|
|
|
|
|
|
var .byte varb1 = 99
|
|
|
|
memory .byte memb1 = $cff0
|
2017-12-21 21:16:46 +00:00
|
|
|
const .word constw = $2355
|
|
|
|
const .byte constb = $23
|
2017-12-23 00:53:48 +00:00
|
|
|
const .float constf = 3.4556677
|
|
|
|
const .text constt = "derp"
|
2017-12-21 21:16:46 +00:00
|
|
|
|
2017-12-24 23:15:04 +00:00
|
|
|
sub sub1 () -> (X?) = $ffdd
|
|
|
|
sub sub2 (A) -> (Y?) = $eecc
|
2017-12-21 21:16:46 +00:00
|
|
|
|
2017-12-21 13:52:30 +00:00
|
|
|
|
|
|
|
bar
|
2017-12-23 13:36:23 +00:00
|
|
|
goto sub1
|
|
|
|
goto sub2 (1 )
|
|
|
|
goto bar ()
|
|
|
|
goto [AX]
|
|
|
|
goto [AX] ()
|
|
|
|
goto [var1]
|
|
|
|
goto [var1] () ; comment
|
|
|
|
goto [mem1] ; comment
|
|
|
|
goto [mem1] ()
|
|
|
|
goto [$c2.word]
|
|
|
|
goto [$c2.word] ()
|
|
|
|
goto [$c2dd.word]
|
|
|
|
goto [$c2dd.word] ( )
|
|
|
|
goto $c000
|
|
|
|
goto $c000 ( )
|
|
|
|
goto $c2
|
|
|
|
goto $c2()
|
2017-12-21 13:52:30 +00:00
|
|
|
|
|
|
|
asm {
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
}
|
|
|
|
|
2017-12-23 13:36:23 +00:00
|
|
|
sub1!()
|
|
|
|
sub2!(11)
|
|
|
|
bar!()
|
|
|
|
[XY] ! ()
|
|
|
|
[var1] !()
|
|
|
|
[mem1]!()
|
|
|
|
[$c2.word]!()
|
|
|
|
[$c2dd.word]!()
|
|
|
|
$c000!()
|
|
|
|
$c2!()
|
2017-12-21 13:52:30 +00:00
|
|
|
|
|
|
|
asm {
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
}
|
|
|
|
|
2017-12-23 13:36:23 +00:00
|
|
|
sub1()
|
|
|
|
sub2(11)
|
|
|
|
bar ()
|
|
|
|
[AX]()
|
|
|
|
[var1] ( )
|
|
|
|
[mem1] ()
|
|
|
|
[$c2.word]()
|
|
|
|
[$c2dd.word]()
|
|
|
|
$c000()
|
|
|
|
$c2()
|
2017-12-21 21:16:46 +00:00
|
|
|
|
|
|
|
|
2017-12-21 22:05:35 +00:00
|
|
|
asm {
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
}
|
|
|
|
|
2017-12-23 13:36:23 +00:00
|
|
|
constw()
|
|
|
|
sub1()
|
|
|
|
main.start()
|
2017-12-21 13:52:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
~ main {
|
|
|
|
|
|
|
|
start
|
2017-12-23 13:36:23 +00:00
|
|
|
foo.bar()
|
2017-12-21 13:52:30 +00:00
|
|
|
return
|
2017-12-25 18:09:10 +00:00
|
|
|
|
|
|
|
sub unused_sub ()->() {
|
|
|
|
A=X
|
|
|
|
X=Y
|
|
|
|
Y=A
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-12-21 13:52:30 +00:00
|
|
|
}
|