2021-11-14 21:51:02 +00:00
|
|
|
%import textio
|
2021-11-16 23:04:52 +00:00
|
|
|
%import floats
|
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-16 23:04:52 +00:00
|
|
|
byte bb
|
|
|
|
float fl
|
2021-11-14 21:51:02 +00:00
|
|
|
|
2021-11-18 00:43:22 +00:00
|
|
|
|
|
|
|
; TODO add these constant folders:
|
2021-11-14 11:38:56 +00:00
|
|
|
|
2021-11-16 23:57:00 +00:00
|
|
|
; (X + C1) + (Y + C2) => (X + Y) + (C1 + C2)
|
|
|
|
; (X + C1) - (Y + C2) => (X - Y) + (C1 - C2)
|
|
|
|
; ---> together: (X + C1) <plusmin> (Y + C2) => (X <plusmin> Y) + (C1 <plusmin> C2)
|
2021-11-05 22:25:07 +00:00
|
|
|
|
2021-11-16 23:57:00 +00:00
|
|
|
|
|
|
|
; (X - C1) + (Y - C2) => (X + Y) - (C1 + C2)
|
|
|
|
; (X - C1) - (Y - C2) => (X - Y) - (C1 - C2)
|
|
|
|
|
|
|
|
xx=6
|
|
|
|
yy=8
|
|
|
|
|
|
|
|
yy = (xx+5)+(yy+10)
|
|
|
|
txt.print_ub(yy) ; 29
|
|
|
|
txt.nl()
|
|
|
|
|
|
|
|
xx=100
|
|
|
|
yy=8
|
2021-11-18 00:43:22 +00:00
|
|
|
yy = (xx+5)-(yy+10)
|
2021-11-16 23:57:00 +00:00
|
|
|
txt.print_ub(yy) ; 87
|
|
|
|
txt.nl()
|
|
|
|
|
|
|
|
xx=50
|
|
|
|
yy=40
|
|
|
|
yy = (xx-5)+(yy-10)
|
|
|
|
txt.print_ub(yy) ; 75
|
|
|
|
txt.nl()
|
|
|
|
|
|
|
|
xx=50
|
|
|
|
yy=20
|
|
|
|
yy = (xx-5)-(yy-10)
|
|
|
|
txt.print_ub(yy) ; 35
|
|
|
|
txt.nl()
|
|
|
|
|
|
|
|
repeat {
|
|
|
|
}
|
2021-11-16 22:52:30 +00:00
|
|
|
}
|
2021-05-12 22:35:22 +00:00
|
|
|
}
|