1
0
mirror of https://github.com/KarolS/millfork.git synced 2026-04-26 10:20:51 +00:00

Fix comparisons

This commit is contained in:
Karol Stasiak
2018-08-03 16:21:02 +02:00
parent fab1cafec3
commit f4a2c96512
12 changed files with 367 additions and 137 deletions
+6 -3
View File
@@ -144,9 +144,12 @@ Note you cannot mix those operators, so `a <= b < c` is not valid.
`simple word > simple word`
`simple long > simple long`
Currently, `>`, `<`, `<=`, `>=` operators perform unsigned comparison
if none of the types of their arguments is signed,
and fail to compile otherwise. This will be changed in the future.
Currently, `>`, `<`, `<=`, `>=` operators perform signed comparison
if any of the types of their arguments is signed,
and unsigned comparison otherwise.
**WARNING:** On targets using Intel 8080 and Sharp LR35902, a signed comparison `a OP b` is compiled as `a - b OP 0`,
which may give wrong results if the subtraction overflows.
## Assignment and in-place modification operators