prog8/il65/examples/test.ill

131 lines
2.1 KiB
Plaintext
Raw Normal View History

2018-08-16 21:10:28 +00:00
%output prg
%launcher basic
2018-09-02 16:32:48 +00:00
%import c64lib
~ main $c003 {
2018-08-16 21:10:28 +00:00
A = X>2
X = Y>Y
2018-08-14 14:46:34 +00:00
word[1000] ascending = 10 to 1009
2018-08-14 14:29:08 +00:00
word[100] ascending2 = "a" to "z"
str ascending3 = "a" to "z"
str ascending5 = "z" to "z"
const byte cc = 4 + (2==9)
byte cc2 = 4 - (2==10)
2018-08-13 23:15:11 +00:00
memory byte derp = max($ffdd)
memory byte derpA = abs(-2.5-0.5)
memory byte derpB = max(1, 2.2, 4.4, 100)
2018-08-16 13:09:24 +00:00
memory byte cderp = min($ffdd)+ (1/1)
2018-08-13 23:15:11 +00:00
memory byte cderpA = min($ffdd, 10, 20, 30)
memory byte cderpB = min(1, 2.2, 4.4, 100)
memory byte derp2 = 2+$ffdd+round(10*sin(3))
const byte hopla=55-33
2018-08-13 21:28:04 +00:00
const byte hopla3=100+(-hopla)
const byte hopla4 = 100-hopla
const byte hopla1=main.hopla
const float blerp1 = zwop / 2.22
const float zwop = -1.7014118345e+38
2018-08-13 21:28:04 +00:00
const float zwop2 = -1.7014118345e+38
const float blerp2 = zwop / 2.22
2018-08-14 12:33:36 +00:00
const byte equal = 4==4
const byte equal2 = (4+hopla)>0
goto mega
2018-09-02 16:32:48 +00:00
if_eq goto mega
if_eq {
A=99
} else {
A=100
}
2018-08-14 14:29:08 +00:00
%breakpoint
byte equalQQ = 4==4
const byte equalQQ2 = (4+hopla)>0
2018-09-02 09:54:42 +00:00
_P_carry(1)
_P_irqd(0)
2018-09-01 17:28:11 +00:00
2018-08-16 14:22:51 +00:00
equalQQ = foo(33)
equalQQ = main.foo(33)
2018-08-13 21:28:04 +00:00
XY = hopla*2+hopla1
A = "derp" * %000100
2018-08-14 14:29:08 +00:00
byte equalWW = 4==4
const byte equalWW2 = (4+hopla)>0
if (1==1) goto cool
2018-08-14 12:33:36 +00:00
if (1==2) return 44
if (2==2) A=4
if (3==3) X=5 else A=99
if (5==5) {
A=99
2018-08-14 14:29:08 +00:00
%breakpoint
2018-08-14 12:33:36 +00:00
}
if(6==6) {
2018-09-02 09:54:42 +00:00
A=sin(X)
X=max(1,2,Y)
X=min(1,2,Y)
X=_lsl(1)
X=_lsl(Y)
_P_carry(0)
_P_carry(Y) ; TODO error
_P_carry(9.99) ; TODO error
_P_irqd(0)
_P_irqd(Y) ; TODO error
_P_irqd(9.99) ; TODO error
2018-08-14 12:33:36 +00:00
} else X=33
2018-08-14 14:29:08 +00:00
if(6>36) {
2018-08-14 12:33:36 +00:00
A=99
} else {
X=33
}
2018-08-14 00:22:59 +00:00
main.foo(1,2,3)
2018-08-13 18:28:15 +00:00
mega:
2018-08-16 21:10:28 +00:00
X += 1
2018-08-13 18:28:15 +00:00
cool:
Y=2
2018-08-13 02:12:42 +00:00
sub foo () -> () {
2018-08-13 21:28:04 +00:00
byte blerp = 3
2018-08-13 02:12:42 +00:00
A=99
return 33
ultrafoo()
2018-08-13 02:12:42 +00:00
X =33
2018-08-13 18:28:15 +00:00
mega:
cool:
sub ultrafoo() -> () {
return 33
goto main.mega
}
2018-08-13 18:28:15 +00:00
2018-08-13 02:12:42 +00:00
}
2018-08-13 18:28:15 +00:00
some_label_def: A=44
return 1+999
%breakpoint
%asminclude "derp", hopsa
%asmbinary "derp", 0, 200
}
2018-08-16 15:08:26 +00:00
%option enable_floats
%option enable_floats
%option enable_floats
%import imported
%import imported
%import imported2
2018-08-13 18:28:15 +00:00
%import imported2