ZX Spectrum character set

It also differs in its use of the C0 control codes other than the common BS and CR, and it makes use of the 128 high-bit characters beyond the ASCII range.

[1] The ZX Spectrum's main set of printable characters and system font are also used by the Jupiter Ace computer.

In the 128 BASIC mode introduced later, this was changed to 19 UDG characters ending at 0xA2 followed by the two new tokens SPECTRUM and PLAY.

The location is pointed to by the system variable UDG[2] which can be found at memory address 23675/6 (0x5C7B/C) and can be changed.

The TK90X, a Brazilian clone of the ZX Spectrum included an in ROM application to graphically edit these UDG characters, along with functionality to preload then with accented letters used in Portuguese.

(For this, the TK90X defined two extra Basic commands at the codes 0 and 1, respectively TRACE and UDG)[3] The definition of the main system font, 32 (space) to 127 (copyright), are referenced by the system variable CHARS which can be found at memory address 23606/7 (0x5C36/7).

Entire alternative fonts can be loaded into RAM and the CHARS variable re-pointed accordingly.

In a Sinclair BASIC program numeric constants are stored as ASCII followed by a 0x0E byte and a 5-byte binary floating point representation.

When listing a BASIC program only the ASCII part is used but at runtime only the binary representation is used.

[6] For example, a BASIC line displayed as GO TO 10 could contain the ASCII characters for digits 1 and 0 followed by a 0x0E byte and the floating-point representation of 100 instead of 10.

Screenshot of output from a Sinclair BASIC program that demonstrates all printable code points including BASIC keywords and the User-Defined Graphics characters (by default defined as copies of the A-U glyphs)