mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-03-06 21:30:27 +00:00
Fix to make statically-evaluated unsigned comparisons evaluate to 1 if true.
Previously, they evaluated to -1. The following example shows the problem: #include <stdio.h> int main(void) { printf("%i\n", 0U <= 5U); }
This commit is contained in:
parent
018f5a7548
commit
0cf948e3bd
@ -145,8 +145,7 @@ result equ 0
|
|||||||
lda x
|
lda x
|
||||||
cmp y
|
cmp y
|
||||||
lb1 blt lb2
|
lb1 blt lb2
|
||||||
dec result
|
inc result
|
||||||
dec result+2
|
|
||||||
|
|
||||||
lb2 return 2:result
|
lb2 return 2:result
|
||||||
end
|
end
|
||||||
@ -170,8 +169,7 @@ result equ 0
|
|||||||
lda x
|
lda x
|
||||||
cmp y
|
cmp y
|
||||||
lb1 ble lb2
|
lb1 ble lb2
|
||||||
dec result
|
inc result
|
||||||
dec result+2
|
|
||||||
|
|
||||||
lb2 return 2:result
|
lb2 return 2:result
|
||||||
end
|
end
|
||||||
@ -195,8 +193,7 @@ result equ 0
|
|||||||
lda x
|
lda x
|
||||||
cmp y
|
cmp y
|
||||||
lb1 bgt lb2
|
lb1 bgt lb2
|
||||||
dec result
|
inc result
|
||||||
dec result+2
|
|
||||||
|
|
||||||
lb2 return 2:result
|
lb2 return 2:result
|
||||||
end
|
end
|
||||||
@ -220,8 +217,7 @@ result equ 0
|
|||||||
lda x
|
lda x
|
||||||
cmp y
|
cmp y
|
||||||
lb1 bge lb2
|
lb1 bge lb2
|
||||||
dec result
|
inc result
|
||||||
dec result+2
|
|
||||||
|
|
||||||
lb2 return 2:result
|
lb2 return 2:result
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user