2018-01-01 22:24:39 +00:00
|
|
|
%output prg,basic
|
2018-01-03 20:43:19 +00:00
|
|
|
%import c64lib
|
|
|
|
%import mathlib
|
2017-12-30 23:48:00 +00:00
|
|
|
|
2018-01-07 03:39:21 +00:00
|
|
|
~ main $4444 {
|
2018-01-01 22:24:39 +00:00
|
|
|
|
2018-01-07 18:14:21 +00:00
|
|
|
%saveregisters true, false
|
|
|
|
|
2018-01-01 22:24:39 +00:00
|
|
|
|
2018-01-01 17:57:12 +00:00
|
|
|
const num = 2
|
|
|
|
var var1 =2
|
2018-01-08 02:31:23 +00:00
|
|
|
var .word wvar1 = 2 + foo() ; @todo constant
|
2018-01-01 17:57:12 +00:00
|
|
|
|
2018-01-07 18:14:21 +00:00
|
|
|
|
2018-01-03 20:43:19 +00:00
|
|
|
start:
|
2018-01-07 18:14:21 +00:00
|
|
|
|
2018-01-08 02:31:23 +00:00
|
|
|
wvar1 = 2+foo()
|
2018-01-07 18:14:21 +00:00
|
|
|
|
2018-01-01 22:46:33 +00:00
|
|
|
A=math.randbyte()
|
2018-01-03 20:43:19 +00:00
|
|
|
A += c64.RASTER
|
2018-01-01 22:46:33 +00:00
|
|
|
A-=c64.TIME_LO
|
|
|
|
X,A=math.divmod_bytes(A, 99)
|
2018-01-07 01:36:27 +00:00
|
|
|
A=B=C=foo()
|
2018-01-01 22:46:33 +00:00
|
|
|
c64scr.print_byte_decimal(A)
|
|
|
|
c64.CHROUT('\n')
|
|
|
|
return
|
|
|
|
|
2018-01-08 00:51:36 +00:00
|
|
|
screen = border = cursor = X = Y = A = X = Y = A = border = cursor = border = cursor = 66 ; multi-assign!
|
|
|
|
X = Y = A = X = Y = A = X = Y = A = X = Y = AX = Y = A = X = AY = XY =A = 123 ; multi-assign!
|
|
|
|
XY = XY
|
|
|
|
A= A
|
|
|
|
A=X=Y=A
|
|
|
|
|
2018-01-01 22:46:33 +00:00
|
|
|
|
2018-01-03 20:43:19 +00:00
|
|
|
rndloop:
|
2018-01-01 22:46:33 +00:00
|
|
|
XY = math.randword()
|
|
|
|
%asm {
|
|
|
|
txa
|
|
|
|
sta $0400,y
|
|
|
|
tya
|
|
|
|
sta $0500,x
|
|
|
|
}
|
2018-01-07 01:36:27 +00:00
|
|
|
[wvar1] = 81 ; @todo implement pointers like this
|
2018-01-01 22:46:33 +00:00
|
|
|
goto rndloop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A = math.randbyte()
|
|
|
|
Y=A
|
|
|
|
%asm {
|
|
|
|
txa
|
|
|
|
sta $0400,y
|
|
|
|
}
|
|
|
|
X--
|
|
|
|
if_ne goto rndloop
|
|
|
|
%asm {
|
|
|
|
iny
|
|
|
|
sty math.randbyte._seed
|
|
|
|
}
|
|
|
|
goto rndloop
|
|
|
|
return
|
|
|
|
|
|
|
|
goto start
|
2018-01-01 17:57:12 +00:00
|
|
|
|
|
|
|
X <<= var1
|
|
|
|
X >>= var1
|
|
|
|
|
2018-01-01 16:56:55 +00:00
|
|
|
var1 ++
|
|
|
|
var1 += num
|
|
|
|
X++
|
|
|
|
X+=num
|
2018-01-01 17:57:12 +00:00
|
|
|
X+=0
|
|
|
|
X-=0
|
|
|
|
X <<= Y
|
|
|
|
A <<= X
|
|
|
|
Y <<= A
|
|
|
|
X <<= 0
|
|
|
|
X <<= 33333
|
|
|
|
X >>= 33333
|
|
|
|
X <<= 2
|
|
|
|
X <<= 7
|
|
|
|
X <<= 8
|
|
|
|
X <<= 22
|
|
|
|
X >>= 0
|
|
|
|
X >>= 1
|
|
|
|
X >>= 2
|
|
|
|
X >>= 7
|
|
|
|
X >>= 8
|
|
|
|
X >>= 22
|
2018-01-03 20:43:19 +00:00
|
|
|
XY = 1
|
|
|
|
AX = 2
|
2018-01-05 02:11:13 +00:00
|
|
|
SC =1
|
|
|
|
|
|
|
|
var QW
|
2018-01-03 20:43:19 +00:00
|
|
|
QW =3
|
2018-01-01 17:57:12 +00:00
|
|
|
;XY <<= 0
|
|
|
|
;XY <<= 1
|
|
|
|
;XY <<= 2
|
2018-01-01 16:56:55 +00:00
|
|
|
|
|
|
|
|
2018-01-01 22:24:39 +00:00
|
|
|
%asm {
|
2018-01-01 15:41:08 +00:00
|
|
|
ldy #200
|
|
|
|
- lda #81
|
|
|
|
sta c64.Screen+39-40,y
|
|
|
|
sta c64.Screen+39+4*40,y
|
|
|
|
sta c64.Screen+39+9*40,y
|
|
|
|
sta c64.Screen+39+14*40,y
|
|
|
|
sta c64.Screen+39+19*40,y
|
|
|
|
lda #83
|
|
|
|
sta c64.Screen-40,y
|
|
|
|
sta c64.Screen+4*40,y
|
|
|
|
sta c64.Screen+9*40,y
|
|
|
|
sta c64.Screen+14*40,y
|
|
|
|
sta c64.Screen+19*40,y
|
|
|
|
lda #1
|
|
|
|
sta c64.Colors+39-40,y
|
|
|
|
sta c64.Colors+39+4*40,y
|
|
|
|
sta c64.Colors+39+9*40,y
|
|
|
|
sta c64.Colors+39+14*40,y
|
|
|
|
sta c64.Colors+39+19*40,y
|
|
|
|
lda #5
|
|
|
|
sta c64.Colors-40,y
|
|
|
|
sta c64.Colors+4*40,y
|
|
|
|
sta c64.Colors+9*40,y
|
|
|
|
sta c64.Colors+14*40,y
|
|
|
|
sta c64.Colors+19*40,y
|
|
|
|
tya
|
|
|
|
sec
|
|
|
|
sbc #40
|
|
|
|
tay
|
|
|
|
bne -
|
|
|
|
}
|
2017-12-31 14:50:50 +00:00
|
|
|
|
2018-01-08 00:51:36 +00:00
|
|
|
|
2018-01-03 20:43:19 +00:00
|
|
|
loop :
|
2018-01-01 15:41:08 +00:00
|
|
|
A=c64.GETIN()
|
|
|
|
if_not goto loop
|
2018-01-01 16:56:55 +00:00
|
|
|
c64scr.scroll_right_full(1)
|
2018-01-01 15:41:08 +00:00
|
|
|
goto loop
|
|
|
|
c64.CHROUT(A)
|
|
|
|
goto loop
|
2017-12-31 14:50:50 +00:00
|
|
|
|
2018-01-01 15:41:08 +00:00
|
|
|
;c64scr.print_byte_hex(0, A)
|
|
|
|
;c64.CHROUT(' ')
|
|
|
|
;goto loop
|
|
|
|
|
|
|
|
;return
|
2017-12-31 14:50:50 +00:00
|
|
|
|
2017-12-31 02:19:06 +00:00
|
|
|
A = $11
|
2018-01-08 02:31:23 +00:00
|
|
|
A = $11
|
|
|
|
A = $11
|
|
|
|
X = $11
|
|
|
|
Y = $11
|
|
|
|
X = $11
|
|
|
|
Y = $11
|
2017-12-31 02:19:06 +00:00
|
|
|
X = $22
|
|
|
|
Y = $33
|
|
|
|
|
2018-01-01 22:24:39 +00:00
|
|
|
c64scr.clear_screen (81, 5)
|
2018-01-03 20:43:19 +00:00
|
|
|
c64scr.clear_screen (81, 5)
|
|
|
|
c64scr.clear_screen (81, 5)
|
|
|
|
c64scr.clear_screen (81, 5)
|
|
|
|
c64scr.clear_screen ! (81, 5)
|
|
|
|
c64scr.clear_screen ! (81, 5)
|
|
|
|
c64scr.clear_screen !(81, 5)
|
2018-01-01 22:24:39 +00:00
|
|
|
c64scr.clear_screen !(81, 5)
|
|
|
|
c64scr.clear_screen !A (81, 5)
|
|
|
|
c64scr.clear_screen !X (81, 5)
|
|
|
|
c64scr.clear_screen !Y (81, 5)
|
|
|
|
c64scr.clear_screen !XY (81, 5)
|
|
|
|
c64scr.clear_screen !AXY (81, 5)
|
2017-12-31 02:19:06 +00:00
|
|
|
|
|
|
|
c64scr.print_byte_hex(1,A)
|
|
|
|
c64.CHROUT(' ')
|
|
|
|
c64scr.print_byte_hex(1,X)
|
|
|
|
c64.CHROUT(' ')
|
|
|
|
c64scr.print_byte_hex(1,Y)
|
|
|
|
c64scr.print_word_decimal(1222)
|
|
|
|
c64.CHROUT('\n')
|
2017-12-30 23:48:00 +00:00
|
|
|
|
2018-01-07 18:14:21 +00:00
|
|
|
%breakpoint
|
|
|
|
|
2017-12-30 12:34:52 +00:00
|
|
|
return
|
2017-12-30 20:36:42 +00:00
|
|
|
|
2018-01-07 18:14:21 +00:00
|
|
|
sub sub1 () -> () {
|
|
|
|
|
|
|
|
%saveregisters off
|
|
|
|
%breakpoint
|
2018-01-08 00:51:36 +00:00
|
|
|
%breakpoint
|
2018-01-07 18:14:21 +00:00
|
|
|
|
|
|
|
label:
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sub emptysub () -> () {
|
|
|
|
|
|
|
|
%saveregisters on
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
~ zzzz {
|
|
|
|
|
|
|
|
%saveregisters
|
|
|
|
%breakpoint
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
~ {
|
|
|
|
;sdfsdf
|
|
|
|
return
|
|
|
|
;sdfsdf
|
2017-12-30 12:34:52 +00:00
|
|
|
}
|