Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spectrum keywords codes
#1
Hello,

The documentation for CHR function (https://zxbasic.readthedocs.io/en/latest/chr/) says that, although expanded, the function is 100% Sinclair basic compatible.
If it is so, then for the same parameters I'd expect the same output, not only for ascii letters, but also for sinclair basic keywords.

In Sinclair basic, this programme:

Code:
10 CLS
20 FOR i = 230 TO 250
30 PRINT CHR$ i
40 NEXT i

gives some Basic keywords in the output (see the attached image zxkeywords_sinclair.png).

.png   zxkeywords_sinclair.png (Size: 10.26 KB / Downloads: 106)

The equivalent programme in ZX Basic:
Code:
dim i as ubyte

cls
for i = 230 to 250
    print chr(i)
next

outputs some silly characters (see the attached image zxkeywords_boriel.png).

.png   zxkeywords_boriel.png (Size: 11.44 KB / Downloads: 84)

Compiled with:
Quote:..\..\zxbasic\zxbc.exe --optimize 2 --output zxkeywords.tzx --output-format tzx --BASIC --autorun --explicit --strict zxkeywords.bas

I'd say it is a bug.

Swan, my ZX Spectrum emulator https://github.com/zoran-vucenovic/swan
Reply


Messages In This Thread
Spectrum keywords codes - by Zoran - 03-07-2025, 08:01 PM
RE: Spectrum keywords codes - by boriel - 03-08-2025, 11:00 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)