prog8/examples/test.p8

49 lines
1020 B
Plaintext
Raw Normal View History

2022-05-19 20:08:22 +00:00
%import textio
%import math
2022-05-19 20:08:22 +00:00
%zeropage dontuse
2022-03-13 11:52:12 +00:00
; NOTE: meant to test to virtual machine output target (use -target vitual)
2021-10-30 13:15:11 +00:00
main {
2022-05-17 16:53:18 +00:00
sub start() {
2022-05-19 20:08:22 +00:00
byte @shared xx = 11
byte @shared yy = 62
byte @shared yy2 = 15
byte @shared yy3 = 127
ubyte @shared ubx = 3
2022-05-19 20:08:22 +00:00
xx = xx + 9
txt.print_b(xx) ; 20
txt.nl()
xx = xx * 8
txt.print_b(xx) ; -96
txt.nl()
xx = xx - 7
txt.print_b(xx) ; -103
txt.nl()
xx = xx / 6
txt.print_b(xx) ; -17
txt.nl()
txt.nl()
2022-05-19 20:08:22 +00:00
; xx = xx+3*yy
; xx = xx/yy
; xx = -xx
; @($4000) = @($4000)
; @($4000) = @($4000) + 2
; xx = xx ^ yy
; xx = xx | yy2
; xx = xx & yy3
; txt.print_b(xx) ; 63
; txt.nl()
; xx = (not xx) as byte
; xx = (~xx) as byte
; xx++
; txt.print_b(xx) ; 0
; txt.nl()
;
; ubx = not ubx
; ubx = ~ubx
2022-03-04 21:26:46 +00:00
}
2022-02-17 23:40:31 +00:00
}