Posts: 35
Threads: 8
Joined: Nov 2015
Reputation:
0
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 !
Posts: 1,766
Threads: 55
Joined: Aug 2019
Reputation:
24
Yes, it crash the print routine. Thanks, will check for it. :roll:
Also, using basic returns an K Invalid Colour error.
You can use control color codes as with normal PRINT, since it saves memory and can, sometimes, be faster than INK, FLASH, etc.
So color codes can be useful.
Posts: 35
Threads: 8
Joined: Nov 2015
Reputation:
0
Can I please come back to this and ask if you can have a look at it?
Trying further I discover strangely that running the resulting code on different Spectrum-Emulators (SpecEmu, Fuse)
displays different results on crashing. But this maybe have to do with different Hardware-Addons selected in Emulators.
Which emulator do you use for testing?
Also, PRINT not seems to be very fast. Do you know of a way to maybe speed this up?
E.g. with a PRINT function that prints "without colours or so"?
Update: I will give the printing routine from:
<!-- m --><a class="postlink" href="https://wos.meulie.net/pub/sinclair/books/a/AdvancedSpectrumMachineLanguage.pdf">https://wos.meulie.net/pub/sinclair/boo ... nguage.pdf</a><!-- m -->
a try, if this can speed something further up for me.
On the WIKI <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Print42.bas">http://www.boriel.com/wiki/en/index.php ... rint42.bas</a><!-- m -->
I maybe find a typo: I think the example should read "print42(STRING)" instead of "printat42(STRING)".
There maybe also the same typo on the Print64-Wiki-Page: <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Print64.bas">http://www.boriel.com/wiki/en/index.php ... rint64.bas</a><!-- m -->