Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 218 online users. » 0 Member(s) | 215 Guest(s) Baidu, Bing, Google
|
Latest Threads |
Strange Happenings
Forum: Bug Reports
Last Post: zedex82
9 hours ago
» Replies: 0
» Views: 6
|
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 370
|
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 310
|
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,621
|
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 571
|
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 910
|
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 354
|
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,078
|
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,903
|
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 426
|
|
|
PRINT AT 23,0 and FOR NEXT Loop not working after Fastcall |
Posted by: Luzie - 12-27-2015, 05: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 - 12-17-2015, 03: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 - 11-19-2015, 05: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 - 11-05-2015, 09: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 - 11-04-2015, 03: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 .
|
|
|
|