| Welcome, Guest |
You have to register before you can post on our site.
|
| Online Users |
There are currently 106 online users. » 0 Member(s) | 105 Guest(s) Applebot
|
| Latest Threads |
GuSprites
Forum: Help & Support
Last Post: zedex82
2026-06-19, 06:39 PM
» Replies: 2
» Views: 356
|
New video Couse / Nuevo c...
Forum: News
Last Post: Duefectu
2026-04-29, 11:02 PM
» Replies: 0
» Views: 2,701
|
location of heap manageme...
Forum: Help & Support
Last Post: boriel
2026-03-07, 12:13 AM
» Replies: 1
» Views: 745
|
non-paged supervisor code...
Forum: Help & Support
Last Post: sdo303
2026-02-20, 06:38 PM
» Replies: 8
» Views: 1,848
|
How to open fuse as an ex...
Forum: How-To & Tutorials
Last Post: Duefectu
2026-02-09, 01:52 PM
» Replies: 3
» Views: 1,743
|
Old zxbasic game errors
Forum: Help & Support
Last Post: boriel
2025-11-09, 11:52 AM
» Replies: 7
» Views: 2,540
|
Error: Undefined GLOBAL l...
Forum: Help & Support
Last Post: ardentcrest
2025-11-04, 05:46 PM
» Replies: 3
» Views: 1,396
|
A Fast(er) Plot Routine f...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-30, 03:16 PM
» Replies: 2
» Views: 1,479
|
Hall of Fame - Include fo...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-28, 03:48 PM
» Replies: 0
» Views: 820
|
[SOLVED] Array layout bug...
Forum: Bug Reports
Last Post: Zoran
2025-10-25, 05:48 PM
» Replies: 2
» Views: 1,539
|
|
|
| PRINT AT 23,0 and FOR NEXT Loop not working after Fastcall |
|
Posted by: Luzie - 2015-12-27, 06:54 PM - Forum: Bug Reports
- Replies (14)
|
 |
Hi,
I´ve tried but now yet find the issue for this:
I´m writing a BASIC program (with help of LCDs BorIDE) with a FASTCALL Function ASM
which itself calls a machine code routine in Spectrum Betadisk / TR-DOS ROM.
If have the FASTCALL NOT active in my BASIC program then these BASIC line work:
PRINT AT 23,0;"XXX"
and
DIM A AS UINTEGER
FOR A=59999 TO 60008
PRINT A, PEEK(A); " "
NEXT A
BUT if I activate the FASTCALL
and then run those BASIC lines
I get error: 5 Out of Screen on: PRINT AT 23,0;"XXX"
and I get output 60000 to 60008 on the loop (instead of output 59999 to 60008)
Because of it´s complexity I won´t post my whole source here,
as you need BorIDE and an emulator like Fuse and some additional files (like TRDOS-Disk-Image) to test it completly.
I you like, I can send this all packed together directly to you.
But maybe on reading the above you have an Idea what could be the reason ?
Regards,
Luzie
|
|
|
| Yet another optimized bug |
|
Posted by: einar - 2015-12-17, 04:14 PM - Forum: Bug Reports
- No Replies
|
 |
Sample program test.bas:
Code: GOTO 10
sub FASTCALL proc1()
asm
start:
ld hl,(stuff)
ld (23672),hl
ret
stuff:
defw 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
defw 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
defw 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
defw 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
end asm
end sub
sub FASTCALL proc2(a AS UBYTE)
asm
cp 10
jr nz, skip
dec a
skip:
jp start
end asm
end sub
10 proc1()
proc2(0)
Compiling it using -O2 works correctly and produces the following code for routine proc2:
Code: _proc2:
#line 17
cp 10
jr nz, skip
dec a
skip:
jp start
#line 22
_proc2__leave:
ret
Compiling it using -O3 produces error "Relative jump out of range" and produces the following code for routine proc2:
Code: _proc2:
#line 17
cp 10
jr nz, start
dec a
skip:
jp start
#line 22
_proc2__leave:
ret
Again, the optimizer is supposed to try to optimize its own generated code only, not someone else's assembly code!
|
|
|
|