2021-11-14 21:51:02 +00:00
|
|
|
%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
|
|
|
|
2021-11-09 23:17:56 +00:00
|
|
|
sub start() {
|
2021-11-13 11:56:59 +00:00
|
|
|
|
2021-11-16 22:52:30 +00:00
|
|
|
ubyte xx = 1.234
|
|
|
|
ubyte yy = 2.234
|
|
|
|
uword aw
|
2021-11-14 21:51:02 +00:00
|
|
|
|
2021-11-16 22:52:30 +00:00
|
|
|
; TODO: bitwise operations with a negative constant number -> replace the number by its positive 2 complement
|
2021-11-14 11:38:56 +00:00
|
|
|
|
2021-11-16 22:52:30 +00:00
|
|
|
aw = xx ^ 65535
|
|
|
|
aw = ~xx
|
|
|
|
yy = xx ^ 255
|
|
|
|
yy = ~xx
|
2021-11-14 21:51:02 +00:00
|
|
|
|
2021-11-16 22:52:30 +00:00
|
|
|
; *(&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
|
|
|
|
2021-11-16 22:52:30 +00:00
|
|
|
txt.print_ub(yy)
|
|
|
|
txt.print_uw(aw)
|
2021-11-05 22:25:07 +00:00
|
|
|
|
2021-11-16 22:52:30 +00:00
|
|
|
}
|
2021-05-12 22:35:22 +00:00
|
|
|
}
|