prog8/examples/test.p8

126 lines
2.1 KiB
Plaintext
Raw Normal View History

2020-08-27 18:47:22 +00:00
%import c64textio
2020-08-27 17:47:50 +00:00
%zeropage basicsafe
main {
sub start() {
;asmsub clear_screen (ubyte char @ A, ubyte color @ Y) clobbers(A) { ...}
; TODO dont cause name conflict if we define sub or sub with param 'color' or even a var 'color' later.
; sub color(...) {}
; sub other(ubyte color) {} ; TODO don't cause name conflict
byte b1
byte b2
byte b3
2020-08-27 17:47:50 +00:00
word w1
word w2
word w3
2020-08-27 18:47:22 +00:00
b2 = 13
b3 = 100
b1 = b3 / b2
txt.print_b(b1)
c64.CHROUT('\n')
b2 = -13
b3 = 100
b1 = b3 / b2
txt.print_b(b1)
c64.CHROUT('\n')
b2 = 13
b3 = -100
b1 = b3 / b2
txt.print_b(b1)
c64.CHROUT('\n')
b2 = -13
b3 = -100
b1 = b3 / b2
txt.print_b(b1)
c64.CHROUT('\n')
b2 = 13
b3 = 100
b3 /= b2
txt.print_b(b3)
c64.CHROUT('\n')
b2 = -13
b3 = 100
b3 /= b2
txt.print_b(b3)
c64.CHROUT('\n')
b2 = 13
b3 = -100
b3 /= b2
txt.print_b(b3)
c64.CHROUT('\n')
b2 = -13
b3 = -100
b3 /= b2
txt.print_b(b3)
c64.CHROUT('\n')
c64.CHROUT('\n')
w2 = 133
w3 = 20000
w1 = w3 / w2
txt.print_w(w1)
c64.CHROUT('\n')
w2 = -133
w3 = 20000
w1 = w3 / w2
txt.print_w(w1)
c64.CHROUT('\n')
w2 = 133
w3 = -20000
w1 = w3 / w2
txt.print_w(w1)
c64.CHROUT('\n')
w2 = -133
w3 = -20000
w1 = w3 / w2
txt.print_w(w1)
c64.CHROUT('\n')
w2 = 133
w3 = 20000
w3 /= w2
txt.print_w(w3)
c64.CHROUT('\n')
w2 = -133
w3 = 20000
w3 /= w2
txt.print_w(w3)
c64.CHROUT('\n')
w2 = 133
w3 = -20000
w3 /= w2
txt.print_w(w3)
c64.CHROUT('\n')
w2 = -133
w3 = -20000
w3 /= w2
txt.print_w(w3)
2020-08-27 17:47:50 +00:00
c64.CHROUT('\n')
}
}