| Welcome, Guest |
You have to register before you can post on our site.
|
| Forum Statistics |
» Members: 270
» Latest member: Exile
» Forum threads: 1,083
» Forum posts: 6,474
Full Statistics
|
| Online Users |
There are currently 63 online users. » 0 Member(s) | 62 Guest(s) Bing
|
| Latest Threads |
Old zxbasic game errors
Forum: Help & Support
Last Post: boriel
2025-11-09, 11:52 AM
» Replies: 7
» Views: 869
|
Error: Undefined GLOBAL l...
Forum: Help & Support
Last Post: ardentcrest
2025-11-04, 05:46 PM
» Replies: 3
» Views: 425
|
A Fast(er) Plot Routine f...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-30, 03:16 PM
» Replies: 2
» Views: 458
|
Hall of Fame - Include fo...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-28, 03:48 PM
» Replies: 0
» Views: 267
|
[SOLVED] Array layout bug...
Forum: Bug Reports
Last Post: Zoran
2025-10-25, 05:48 PM
» Replies: 2
» Views: 519
|
3DOS Commands?
Forum: Help & Support
Last Post: boriel
2025-10-06, 02:54 PM
» Replies: 3
» Views: 641
|
How to open fuse as an ex...
Forum: How-To & Tutorials
Last Post: zedex82
2025-10-05, 07:36 PM
» Replies: 2
» Views: 516
|
CLS/Fade out ASM Sub-rout...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-05, 03:39 PM
» Replies: 2
» Views: 495
|
ZX Basic Studio Bugs
Forum: Bug Reports
Last Post: Duefectu
2025-09-23, 04:07 PM
» Replies: 5
» Views: 1,423
|
Printing with FZX
Forum: Help & Support
Last Post: boriel
2025-07-17, 10:08 PM
» Replies: 1
» Views: 2,102
|
|
|
| Another optimizer bug (*solved*) |
|
Posted by: einar - 2014-11-04, 02:47 AM - Forum: Bug Reports
- Replies (3)
|
 |
Ouch! This bug gave me a headache! It took me some time to figure out the reason my game was crashing...
Take a look at this sample:
Code: sub test()
asm
call $fc12
di
ld a, $fe
ld i, a
im 2
ei
end asm
end sub
test()
Try compiling this sample above using:
Code: zxb.exe -A -O2 prog.bas
And it will produce the expected result:
Code: _test:
push ix
ld ix, 0
add ix, sp
#line 1
call $fc12
di
ld a, $fe
ld i, a
im 2
ei
#line 7
_test__leave:
ld sp, ix
pop ix
ret
However try compiling it again using:
Code: zxb.exe -A -O3 prog.bas
Now the result won't make sense anymore:
Code: _test:
push ix
ld ix, 0
add ix, sp
#line 1
call $fc12
di
im 2
ei
#line 7
_test__leave:
ld sp, ix
pop ix
ret
The problem is, the optimizer is supposed to try to optimize its own generated code only, not someone else's assembly code that it doesn't have enough information to understand!
|
|
|
|