2018-08-16 21:10:28 +00:00
|
|
|
%output prg
|
|
|
|
%launcher basic
|
|
|
|
|
2018-09-02 16:32:48 +00:00
|
|
|
%import c64lib
|
|
|
|
|
2018-09-05 21:14:08 +00:00
|
|
|
~ not_main $d000 {
|
2018-09-11 22:51:48 +00:00
|
|
|
byte [100] array1 = 0
|
|
|
|
word [100] array2 = 1
|
|
|
|
byte [2,3] matrix1 = 2
|
|
|
|
byte [2,3] matrix2 = [1,2,3,4,5,6]
|
|
|
|
|
2018-09-13 20:31:59 +00:00
|
|
|
const byte [100] carray1 = 2
|
|
|
|
const word [100] carray2 = 1.w
|
2018-09-11 22:51:48 +00:00
|
|
|
const byte [2,3] cmatrix1 = [1,2,3,4,5,255]
|
|
|
|
|
|
|
|
|
|
|
|
const float len1 = len([1,2,3])
|
|
|
|
const float round1 = len([1,2,3])
|
|
|
|
const float sin1 = len([1,2,3])
|
|
|
|
float cos1 = len([1,2,3])
|
2018-09-05 21:14:08 +00:00
|
|
|
}
|
2018-08-16 21:10:28 +00:00
|
|
|
|
2018-09-05 21:14:08 +00:00
|
|
|
~ main $c003 {
|
2018-09-06 19:13:49 +00:00
|
|
|
word lsb1 = lsb($ea31)
|
|
|
|
word msb1 = msb($ea31)
|
|
|
|
byte lsb2 = lsb($ea31)
|
|
|
|
byte msb2 = msb($ea31)
|
|
|
|
word lsb3 = lsb($ea)
|
|
|
|
word msb3 = msb($ea)
|
|
|
|
|
2018-09-04 21:37:21 +00:00
|
|
|
const word len1 = len([1,2,3,wa1, wa2, ws1, all1])
|
2018-09-04 23:28:06 +00:00
|
|
|
const word wa1 = ceil(abs(-999.22))
|
2018-09-13 20:31:59 +00:00
|
|
|
const byte wa1b = abs(99)
|
|
|
|
const byte wa1c = -(1-99)
|
|
|
|
const byte wa1d = -0
|
2018-09-04 21:37:21 +00:00
|
|
|
const byte wa2 = abs(-99)
|
2018-09-13 20:31:59 +00:00
|
|
|
const byte wa2b= abs(-99.w)
|
|
|
|
const byte wa2c = abs(-99)
|
|
|
|
const word wa2d = abs(-999)
|
2018-09-04 21:37:21 +00:00
|
|
|
const float wa3 = abs(-1.23456)
|
2018-09-04 23:28:06 +00:00
|
|
|
const float wa4 = abs(-133)
|
2018-09-04 21:37:21 +00:00
|
|
|
const float avg1 = avg([-1.23456, 99999])
|
|
|
|
const float sum1 = sum([-1.23456, 99999])
|
|
|
|
const word ws1 = floor(sum([1,2,3,4.9]))
|
|
|
|
const word ws2 = ceil(avg([1,2,3,4.9]))
|
|
|
|
const word ws3 = round(sum([1,2,3,4.9]))
|
|
|
|
const word any1 = any([0,0,0,0,0,22,0,0])
|
2018-09-06 19:13:49 +00:00
|
|
|
const word any2 = any([2+sin(2.0), 2])
|
2018-09-04 21:37:21 +00:00
|
|
|
const word all1 = all([0,0,0,0,0,22,0,0])
|
|
|
|
const word all2 = all([0.0])
|
|
|
|
const word all3 = all([wa1, wa2, ws1, all1])
|
|
|
|
|
2018-09-13 20:31:59 +00:00
|
|
|
const word max1 = max([-1,-2,3.33,99+22])
|
2018-09-04 21:37:21 +00:00
|
|
|
|
|
|
|
const word min1 = min([1,2,3,99+22])
|
2018-09-05 22:08:16 +00:00
|
|
|
word dinges = round(not_main.len1)
|
2018-08-16 21:10:28 +00:00
|
|
|
|
|
|
|
A = X>2
|
|
|
|
X = Y>Y
|
|
|
|
|
2018-09-04 23:28:06 +00:00
|
|
|
byte myByteChar = "A"
|
|
|
|
word myWordChar = "B"
|
2018-08-14 14:46:34 +00:00
|
|
|
word[1000] ascending = 10 to 1009
|
2018-08-14 14:29:08 +00:00
|
|
|
str ascending3 = "a" to "z"
|
|
|
|
str ascending5 = "z" to "z"
|
|
|
|
const byte cc = 4 + (2==9)
|
|
|
|
byte cc2 = 4 - (2==10)
|
2018-09-12 22:46:52 +00:00
|
|
|
; memory byte derp = max([$ffdd]) ; @todo implement memory vars in stackvm
|
|
|
|
; memory byte derpA = abs(-20000)
|
|
|
|
; memory byte derpB = max([1, 2.2, 4.4, 100])
|
|
|
|
; memory byte cderp = min([$ffdd])+ (1/1)
|
|
|
|
; 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.1))
|
2018-08-12 21:09:59 +00:00
|
|
|
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
|
2018-08-12 21:09:59 +00:00
|
|
|
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
|
2018-08-12 21:09:59 +00:00
|
|
|
|
2018-09-12 22:46:52 +00:00
|
|
|
; goto 64738
|
2018-09-07 22:07:25 +00:00
|
|
|
|
2018-09-12 22:46:52 +00:00
|
|
|
A++
|
|
|
|
; derp++
|
2018-09-07 22:07:25 +00:00
|
|
|
cc2--
|
|
|
|
|
2018-09-03 21:19:25 +00:00
|
|
|
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
|
|
|
|
|
|
|
byte equalQQ = 4==4
|
|
|
|
const byte equalQQ2 = (4+hopla)>0
|
|
|
|
|
2018-09-12 22:46:52 +00:00
|
|
|
equalQQ++
|
|
|
|
AX++
|
|
|
|
A=X + round(sin(Y))
|
|
|
|
equalQQ= X
|
|
|
|
equalQQ= len([X, Y, AX])
|
2018-09-04 21:37:21 +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
|
2018-08-12 21:09:59 +00:00
|
|
|
|
2018-08-14 14:29:08 +00:00
|
|
|
byte equalWW = 4==4
|
|
|
|
const byte equalWW2 = (4+hopla)>0
|
|
|
|
|
2018-09-03 21:19:25 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
if(6==6) {
|
2018-09-02 09:54:42 +00:00
|
|
|
A=sin(X)
|
2018-09-04 21:37:21 +00:00
|
|
|
X=max([1,2,Y])
|
|
|
|
X=min([1,2,Y])
|
2018-09-06 19:13:49 +00:00
|
|
|
X=lsl(12)
|
2018-09-04 21:37:21 +00:00
|
|
|
X=lsl(Y)
|
|
|
|
P_carry(0)
|
2018-09-04 23:28:06 +00:00
|
|
|
P_carry(1)
|
|
|
|
P_carry(1-1)
|
2018-09-04 21:37:21 +00:00
|
|
|
P_irqd(0)
|
2018-09-04 23:28:06 +00:00
|
|
|
P_irqd(1)
|
2018-08-14 12:33:36 +00:00
|
|
|
} else X=33
|
|
|
|
|
2018-09-05 20:51:34 +00:00
|
|
|
X= extra233.thingy()
|
2018-09-04 23:28:06 +00:00
|
|
|
|
|
|
|
|
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-09-12 22:46:52 +00:00
|
|
|
return
|
2018-08-14 00:22:59 +00:00
|
|
|
|
2018-09-05 23:02:36 +00:00
|
|
|
sub start () -> () {
|
|
|
|
word dinges = 0
|
2018-09-13 20:31:59 +00:00
|
|
|
word blerp1 =999
|
|
|
|
word blerp3 = 1
|
2018-09-12 22:46:52 +00:00
|
|
|
byte blerp2 =99
|
2018-09-05 23:35:26 +00:00
|
|
|
dinges=blerp1
|
2018-09-12 22:46:52 +00:00
|
|
|
A=blerp1 ; @todo error can't assign word to byte
|
2018-09-13 20:31:59 +00:00
|
|
|
A=blerp3 ; @todo error can't assign word to byte
|
|
|
|
blerp2=blerp3; @todo error can't assign word to byte
|
|
|
|
blerp3 = blerp2
|
2018-09-12 22:46:52 +00:00
|
|
|
A=blerp2
|
2018-09-13 20:31:59 +00:00
|
|
|
A=$02
|
|
|
|
A=$002
|
|
|
|
A=$00ff
|
|
|
|
A=%11001100
|
|
|
|
A=%0010011001
|
|
|
|
A=99.w
|
2018-09-12 22:46:52 +00:00
|
|
|
XY=blerp1
|
|
|
|
X=blerp1 ; @todo error can't assign word to byte
|
|
|
|
X=blerp2
|
2018-09-05 23:02:36 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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-09-12 22:46:52 +00:00
|
|
|
goto start
|
2018-08-13 18:28:15 +00:00
|
|
|
|
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
|
2018-09-07 22:07:25 +00:00
|
|
|
; return 33
|
|
|
|
return
|
2018-09-03 21:19:25 +00:00
|
|
|
ultrafoo()
|
2018-08-13 02:12:42 +00:00
|
|
|
X =33
|
2018-09-12 22:46:52 +00:00
|
|
|
|
2018-08-13 18:28:15 +00:00
|
|
|
mega:
|
|
|
|
cool:
|
2018-09-12 22:46:52 +00:00
|
|
|
return
|
|
|
|
|
2018-09-03 21:19:25 +00:00
|
|
|
sub ultrafoo() -> () {
|
2018-09-05 20:51:34 +00:00
|
|
|
X= extra233.thingy()
|
2018-09-07 22:07:25 +00:00
|
|
|
;return 33
|
|
|
|
return
|
2018-09-03 21:19:25 +00:00
|
|
|
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
|
2018-09-07 22:07:25 +00:00
|
|
|
;return 1+999
|
|
|
|
return
|
2018-08-12 21:09:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
%import imported
|
|
|
|
%import imported
|
|
|
|
%import imported2
|
2018-08-13 18:28:15 +00:00
|
|
|
%import imported2
|