prog8/examples/test.p8

57 lines
1021 B
Plaintext
Raw Normal View History

2020-03-24 23:32:54 +00:00
%import c64lib
%import c64utils
%import c64flt
%zeropage basicsafe
2020-07-26 22:32:59 +00:00
main {
2020-07-26 21:32:20 +00:00
sub start() {
2020-08-18 13:16:56 +00:00
struct Color {
ubyte red
uword green
float blue
}
Color c = [11,22222,3.1234]
2020-08-18 11:49:08 +00:00
; c64scr.print_ub(c.red)
; c64.CHROUT('\n')
; c64scr.print_uw(c.green)
; c64.CHROUT('\n')
; c64flt.print_f(c.blue)
; c64.CHROUT('\n')
2020-08-18 13:16:56 +00:00
uword xx = 4.5678
ubyte bb = 33
foo2(-33)
foo2(bb)
foo2(4.55) ; TODO truncation warning
;foo("zzz", 8.777)
;len(13)
; uword size = len(Color)
; c64scr.print_uw(size)
; c64.CHROUT('\n')
; c64scr.print_ub(len(Color))
; c64.CHROUT('\n')
; c64scr.print_ub(len(c))
; c64.CHROUT('\n')
; c64scr.print_ub(len(c.green))
; c64.CHROUT('\n')
}
sub foo(ubyte aa, word ww) {
ww += aa
}
2020-08-18 14:02:40 +00:00
asmsub foo2(ubyte aa @Pc) {
%asm {{
rts
}}
2020-07-25 23:32:27 +00:00
}
}