| Welcome, Guest |
You have to register before you can post on our site.
|
| Online Users |
There are currently 185 online users. » 0 Member(s) | 182 Guest(s) Baidu, Bing, Google
|
| Latest Threads |
Old zxbasic game errors
Forum: Help & Support
Last Post: boriel
2025-11-09, 11:52 AM
» Replies: 7
» Views: 141
|
Error: Undefined GLOBAL l...
Forum: Help & Support
Last Post: ardentcrest
2025-11-04, 05:46 PM
» Replies: 3
» Views: 110
|
A Fast(er) Plot Routine f...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-30, 03:16 PM
» Replies: 2
» Views: 161
|
Hall of Fame - Include fo...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-28, 03:48 PM
» Replies: 0
» Views: 92
|
[SOLVED] Array layout bug...
Forum: Bug Reports
Last Post: Zoran
2025-10-25, 05:48 PM
» Replies: 2
» Views: 219
|
3DOS Commands?
Forum: Help & Support
Last Post: boriel
2025-10-06, 02:54 PM
» Replies: 3
» Views: 383
|
How to open fuse as an ex...
Forum: How-To & Tutorials
Last Post: zedex82
2025-10-05, 07:36 PM
» Replies: 2
» Views: 280
|
CLS/Fade out ASM Sub-rout...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-05, 03:39 PM
» Replies: 2
» Views: 273
|
ZX Basic Studio Bugs
Forum: Bug Reports
Last Post: Duefectu
2025-09-23, 04:07 PM
» Replies: 5
» Views: 1,083
|
Printing with FZX
Forum: Help & Support
Last Post: boriel
2025-07-17, 10:08 PM
» Replies: 1
» Views: 1,966
|
|
|
| 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!
|
|
|
| Compile error - INKEY$ can't be called in a FOR loop |
|
Posted by: mathez - 2015-11-19, 06:59 AM - Forum: Help & Support
- Replies (1)
|
 |
Hello,
I am using version 1.3.0-s1121, though I've also tried 1.4.0s1967, and have the following simple program:
Code: 10 FOR l = 1 to 30
IF INKEY$ <> "" THEN GOTO 100
NEXT l
GOTO 10
100 PRINT "*"
The compiler gives these errors:
test.bas:6: Syntax Error. Unexpected token 'NEXT' <NEXT>
test.bas:7: Undeclared label "10"
I am a C/C++ programmer, so I might be missing something but looks like if I have INKEY$ in a FOR loop, it doesn't compile. I can remove the GOTO 10 and do a 10: to fix the second error, though that's not very clean syntax with the line number having to be converted to a label.
But, I haven't yet found a workaround for the INKEY$ problem in a FOR loop.
Thanks so much for the help.
|
|
|
| CHR or CHR$ crashing running Spectrum |
|
Posted by: Luzie - 2015-11-05, 10:32 PM - Forum: Bug Reports
- Replies (4)
|
 |
Hi,
I do my first steps into ZX Basic and found this crashing
e.g. X128 Spectrum Emulator when I compile this an run it:
FOR A=0 TO 255
PRINT CHR$ (PEEK(A));
NEXT A
Seems printing some CHR$ is like sending some control codes ...
Can work around this when I just use "printable" Characters above e.g. > CHR$ 32 and < CHR$ 127
And just le me say: I love your ZX Basic !
|
|
|
| DIM At? |
|
Posted by: Haplo - 2015-11-04, 04:53 PM - Forum: Help & Support
- Replies (8)
|
 |
Hi, I'm a newbie with Boriel's ZX Basic and I´m not sure if there is a way to do something like this:
DIM charset(767) As uByte At 49152 => {0,12,48,36,....,(768th byte)}
The idea is to place an array of 768 bytes (like a character set) at a specific memory direction(49152).
I was read the Wiki and I found some references to "DIM At" but it's not clear for me .
|
|
|
|