prog8/examples/test.p8

30 lines
492 B
Plaintext
Raw Normal View History

%import textio
2021-10-27 21:48:02 +00:00
2021-10-30 13:15:11 +00:00
main {
2021-11-06 18:09:33 +00:00
sub start() {
2021-11-13 11:56:59 +00:00
ubyte xx = 1.234
ubyte yy = 2.234
uword aw
; TODO: bitwise operations with a negative constant number -> replace the number by its positive 2 complement
aw = xx ^ 65535
aw = ~xx
yy = xx ^ 255
yy = ~xx
; *(&X) => X
; X % 1 => 0
; X / 1 => X
; X ^ -1 => ~x
; X >= 1 => X > 0
; X < 1 => X <= 0
2021-11-06 17:52:54 +00:00
txt.print_ub(yy)
txt.print_uw(aw)
}
}