mirror of
https://github.com/irmen/prog8.git
synced 2026-04-20 11:17:01 +00:00
fix IR long comparisons (used in for loops for instance)
This commit is contained in:
@@ -677,7 +677,7 @@ class IRCodeGen(
|
||||
when (loopvarDtIr) {
|
||||
IRDataType.BYTE -> rangeEndExclusiveUntyped and 255
|
||||
IRDataType.WORD -> rangeEndExclusiveUntyped and 65535
|
||||
else -> rangeEndExclusiveUntyped and 0x7fffffff
|
||||
else -> rangeEndExclusiveUntyped
|
||||
}
|
||||
val result = mutableListOf<IRCodeChunkBase>()
|
||||
val chunk = IRCodeChunk(null, null)
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
%zeropage basicsafe
|
||||
%option no_sysinit
|
||||
|
||||
; TODO fix:
|
||||
; long lv
|
||||
; lv--
|
||||
|
||||
|
||||
main {
|
||||
; Test the routine
|
||||
sub start() {
|
||||
@@ -10,11 +15,25 @@ main {
|
||||
for lv in 4000 to 94000-1 {
|
||||
counter++
|
||||
}
|
||||
for lv in 70000-1 downto 0 {
|
||||
counter++
|
||||
}
|
||||
for lv in 94000-1 downto 4000 {
|
||||
counter++
|
||||
}
|
||||
for lv in 4000 to 94000-1 step 10 {
|
||||
counter++
|
||||
}
|
||||
for lv in 70000-1 downto 0 step -10 {
|
||||
counter++
|
||||
}
|
||||
for lv in 94000-1 downto 4000 step -10 {
|
||||
counter++
|
||||
}
|
||||
txt.print_l(counter)
|
||||
txt.nl()
|
||||
txt.print_l(275000)
|
||||
txt.nl()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user