2020-03-24 23:32:54 +00:00
|
|
|
%import c64lib
|
2020-03-14 23:47:21 +00:00
|
|
|
%import c64utils
|
2020-04-08 22:12:50 +00:00
|
|
|
%import c64flt
|
2020-04-03 20:44:10 +00:00
|
|
|
%zeropage basicsafe
|
2020-03-24 18:37:54 +00:00
|
|
|
|
2020-07-26 22:32:59 +00:00
|
|
|
main {
|
2020-07-26 16:56:51 +00:00
|
|
|
|
2020-08-22 13:09:54 +00:00
|
|
|
; todo make it possible to use cpu opcodes as varnames such as 'nop'
|
|
|
|
|
2020-07-26 21:32:20 +00:00
|
|
|
sub start() {
|
2020-08-18 13:16:56 +00:00
|
|
|
|
2020-08-22 13:09:54 +00:00
|
|
|
byte ub
|
|
|
|
word uw
|
|
|
|
ubyte x = 1
|
|
|
|
ubyte z = 0
|
|
|
|
|
|
|
|
ubyte[] array = [1,2,3]
|
|
|
|
|
|
|
|
ubyte i
|
|
|
|
ub = %00100001
|
|
|
|
for i in 0 to 9 {
|
|
|
|
c64scr.print_ubbin(ub as ubyte, true)
|
|
|
|
c64.CHROUT('\n')
|
|
|
|
;ub <<= 1
|
|
|
|
;ub <<= x
|
|
|
|
ub <<= (z+1)
|
|
|
|
}
|
|
|
|
c64.CHROUT('\n')
|
|
|
|
;ub = %11000110 ; -123
|
|
|
|
ub = -123
|
|
|
|
for i in 0 to 9 {
|
|
|
|
c64scr.print_ubbin(ub as ubyte, true)
|
|
|
|
c64.CHROUT('\n')
|
|
|
|
;ub >>= 1
|
|
|
|
;ub >>= x
|
|
|
|
ub >>= (z+1)
|
|
|
|
}
|
|
|
|
|
|
|
|
uw = %0011100000000011
|
|
|
|
for i in 0 to 17 {
|
|
|
|
c64scr.print_uwbin(uw as uword, true)
|
|
|
|
c64.CHROUT('\n')
|
|
|
|
;uw <<= 1
|
|
|
|
;uw <<= x
|
|
|
|
uw <<= (z+1)
|
|
|
|
}
|
|
|
|
c64.CHROUT('\n')
|
|
|
|
uw = -12345
|
|
|
|
;uw = %1110000011000100
|
|
|
|
for i in 0 to 17 {
|
|
|
|
c64scr.print_uwbin(uw as uword, true)
|
|
|
|
c64.CHROUT('\n')
|
|
|
|
;uw >>= 1
|
|
|
|
;uw >>= x
|
|
|
|
uw >>= (z+1)
|
|
|
|
}
|
2020-07-25 23:32:27 +00:00
|
|
|
}
|
2020-07-03 23:02:36 +00:00
|
|
|
}
|