![]() |
Spectrum keywords codes - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15) +---- Thread: Spectrum keywords codes (/showthread.php?tid=2618) |
Spectrum keywords codes - Zoran - 03-07-2025 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 gives some Basic keywords in the output (see the attached image zxkeywords_sinclair.png). ![]() The equivalent programme in ZX Basic: Code: dim i as ubyte outputs some silly characters (see the attached image zxkeywords_boriel.png). ![]() 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. RE: Spectrum keywords codes - boriel - 03-08-2025 This is because PRINT is not using the ROM. PRINT is totally implemented from scratch, so BASIC tokens are not output. Only graphic chars and UDG, along with the normal charset supported. |