ZX81 character set

Character encoding used in the Sinclair ZX81 computers

Sinclair ZX81 character set

The Sinclair ZX81 character set rendered in the system font.

Language(s)| English with pseudographics
Created by| Sinclair Research
Preceded by| ZX80 character set
Succeeded by| ZX Spectrum character set

The ZX81 character set is the character encoding used by the Sinclair Research ZX81 family of microcomputers including the Timex Sinclair 1000 and Timex Sinclair 1500. The encoding uses one byte per character for 256 code points. It has no relationship with previously established ones like ASCII or EBCDIC, but it is related though not identical to the character set of the predecessor ZX80.

## Printable characters

[edit]

Screenshot of a ZX81 8K BASIC program that demonstrates all code points including BASIC keywords and nonprintable characters, rendered as question marks.

The character set has 64 unique glyphs present at code points 0–63. With the most significant bit set the character is generated in inverse video; corresponding to code points 128–191. These 128 values are the only displayable ones allowed in the video memory (known as the display file). The remaining code points (64–127 and 192–255) are used as control characters such as 118 for newline or, uniquely to Sinclair BASIC, for keywords, while some are unused.

The small effective range of only 64 unique glyphs precludes support for Latin lower case letters, and many symbols used widely in computing such as the exclamation point and the at sign. The lack of an apostrophe led some software authors to use a comma instead.

There are 11 block graphics characters, counting code point 0 which also doubles as space. The first 8 of these together with their 8 inverse video versions (16 code points) provide every combination of the character cell divided into 2×2 black-and-white block pixels for low-resolution 64×48 pixel graphics. These 2×2 blocks are present in the Block Elements Unicode block. An additional 3 characters provide a cell divided into 1×2 black, white or dithered gray wide block pixels. These, in combination with their inverse video versions and some of the previous 2×2 blocks provides for a 32×48 resolution with 3 levels (white, dithered gray, black). The basic 11 characters plus their inverse video versions, makes for 22 block graphics characters in total. The dithered characters (of which there are 6) are also available in Unicode (mostly in the Symbols for Legacy Computing block), but only in Unicode versions 13.0 and newer, available from 2020 onwards.

Code point 11 is the double-quote (") symbol when used in the display file. The BASIC function `CHR$ 192` prints as the same character but is shown as "" in BASIC source listings; it is used for including the literal " character in a string without conflict with the " string delimiter.[1]

## Changes from the ZX80

[edit]

The character set in the ZX81 was derived from the ZX80 character set. They have mostly the same code points, e.g. for A-Z and 0-9, but the code points are different for the block graphics characters, the symbols ", -, +, *, /, =, >, <, and the BASIC keyword tokens (with many new added). There are also changes to the control characters. Code point 1 is no longer an unprintable string terminator. The ZX81 8K BASIC ROM was also available as an upgrade for the ZX80, replacing its integer-only 4K BASIC ROM.[2]

The ZX81 system font uses an 8×8 pixel-per-character grid where most glyphs fit in 6×6 pixels leaving two pixels horizontal and vertical space between rows and columns. The ZX80's ROM which had slightly wider 7×6 pixel glyphs with only one pixel horizontal space between them. Some glyphs also received a different design in the ZX81 system font, noticeable on the *, the slashed and less rounded 0, and the less rounded $, C, G and J.

In the later ZX Spectrum the entire character encoding was replaced with the ZX Spectrum character set, which is a derivative of ASCII and includes lower case letters and more.

## Character set

[edit]

The following table shows the ZX81 character set. Each character is shown with a potential Unicode equivalent. Space and control characters are represented by the abbreviations for their names.

ZX81 character set[1][3] | 0  | 1  | 2  | 3  | 4  | 5  | 6  | 7  | 8  | 9  | A  | B  | C  | D  | E  | F

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

0x  |  SP  |  |  |  |  |  |  |  |  |  |  | "[a] | £ | $ | : | ?
1x  | ( | ) | > | < | = | + | - | * | / | ; | , | . | 0 | 1 | 2 | 3
2x  | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | G | H | I | J
3x  | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
4x  | RND  | INKEY$  | PI  |  |  |  |  |  |  |  |  |  |  |  |  |
5x  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
6x  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
7x  | UP | DOWN | LEFT | RIGHT | graphics | EDIT | newline | rubout | K/L
MODE | function |  |  |  |  | number | cursor
8x  |  |  |  |  |  |  |  |  |  |  |  | "  | £  | $  | :  | ?
9x  | (  | )  | > | < | =  | \+  | \-  | *  | /  | ;  | ,  | .  | 0  | 1  | 2  | 3
Ax  | 4  | 5  | 6  | 7  | 8  | 9  | A  | B  | C  | D  | E  | F  | G  | H  | I  | J
Bx  | K  | L  | M  | N  | O  | P  | Q  | R  | S  | T  | U  | V  | W  | X  | Y  | Z
Cx  | ""[a] | AT  | TAB  |  | CODE  | VAL  | LEN  | SIN  | COS  | TAN  | ASN  | ACS  | ATN  | LN  | EXP  | INT
Dx  | SQR  | SGN  | ABS  | PEEK  | USR  | STR$  | CHR$  | NOT  | **[b] | OR  | AND  | <=[c] | >=[d] | <>[e] | THEN  | TO
Ex  | STEP  | LPRINT  | LLIST  | STOP  | SLOW  | FAST  | NEW  | SCROLL  | CONT  | DIM  | REM  | FOR  | GOTO  | GOSUB  | INPUT  | LOAD
Fx  | LIST  | LET  | PAUSE  | NEXT  | POKE  | PRINT  | PLOT  | RUN  | SAVE  | RAND  | IF  | CLS  | UNPLOT  | CLEAR  | RETURN  | COPY

Sinclair BASIC tokenizes keywords into single-byte code points.

## See also

[edit]

* ZX80 character set
* ZX Spectrum character set
* Sinclair QL character set
* ATASCII
* Atari ST character set
* PETSCII
* Extended ASCII

## Notes

[edit]

1. ^ a b Code point 11 is the double-quote (") symbol when used in the video memory (called the display file). Code point 192, `CHR$ 192`, prints as the same character but shows as "" in BASIC listings and is used for including the literal " character in a string without conflict with the " string delimiter.[1]
2. ^ The raise to a power multi-character operator tokenized into a single-byte code point.
3. ^ The greater than or equal to multi-character operator tokenized into a single-byte code point.
4. ^ The less than or equal to multi-character operator tokenized into a single-byte code point.
5. ^ The not equal sign multi-character operator tokenized into a single-byte code point.

## References

[edit]

1. ^ a b c Vickers, Steven (1981). Sinclair ZX81 BASIC Programming. Sinclair Research Ltd.
2. ^ "8K BASIC ROM UPGRADE".
3. ^ Wearmouth, Geoff. "An Assembly Listing of the Operating System of the ZX81 ROM". Archived from the original on August 15, 2015.

* v
* t
* e

Character encodings

Early telecommunications|

* Telegraph code
* Needle
* Morse
* Non-Latin
* Wabun/Kana
* Chinese
* Cyrillic
* Baudot and Murray
* Fieldata
* ASCII
* ISO/IEC 646
* BCDIC
* Teletex and Videotex/Teletext
* T.51/ISO/IEC 6937
* ITU T.61
* ITU T.101
* World System Teletext
* background
* sets
* Transcode

ISO/IEC 8859|

* Approved parts
* -1 (Western Europe)
* -2 (Central Europe)
* -3 (Maltese/Esperanto)
* -4 (North Europe)
* -5 (Cyrillic)
* -6 (Arabic)
* -7 (Greek)
* -8 (Hebrew)
* -9 (Turkish)
* -10 (Nordic)
* -11 (Thai)
* -13 (Baltic)
* -14 (Celtic)
* -15 (New Western Europe)
* -16 (Romanian)
* Abandoned parts
* -12 (Devanagari)
* Proposed but not approved
* KOI-8 Cyrillic
* Sámi
* Adaptations
* Welsh
* Estonian
* Ukrainian Cyrillic

Bibliographic use|

* MARC-8
* ANSEL
* CCCII/EACC
* ISO 5426
* 5426-2
* 5427
* 5428
* 6438
* 6862

National standards|

* ArmSCII
* Big5
* BraSCII
* BSCII
* CNS 11643
* DIN 66003
* ELOT 927
* GOST 10859
* GB 2312
* GB 12345
* GB 12052
* GB 18030
* HKSCS
* ISCII
* JIS X 0201
* JIS X 0208
* JIS X 0212
* JIS X 0213
* KOI-7
* KPS 9566
* KS X 1001
* KS X 1002
* LST 1564
* LST 1590-4
* PASCII
* Shift JIS
* SI 960
* TIS-620
* TSCII
* VISCII
* VSCII
* YUSCII

ISO/IEC 2022|

* ISO/IEC 8859
* ISO/IEC 10367
* Extended Unix Code / EUC

Mac OS Code pages
("scripts")|

* Armenian
* Arabic
* Barents Cyrillic
* Celtic
* Central European
* Croatian
* Cyrillic
* Devanagari
* Farsi (Persian)
* Font X (Kermit)
* Gaelic
* Georgian
* Greek
* Gujarati
* Gurmukhi
* Hebrew
* Iceland
* Inuit
* Keyboard
* Latin (Kermit)
* Maltese/Esperanto
* Ogham
* Roman
* Romanian
* Sámi
* Turkish
* Turkic Cyrillic
* Ukrainian
* VT100

DOS code pages|

* 437
* 737
* 850
* 858
* 861
* 862
* 863
* 864
* 865
* 866
* 867
* 868
* 869
* 899
* 904
* 932
* 936
* 942
* 949
* 950
* 951
* 1040
* 1043
* 1046
* 1098
* 1115
* 1116
* 1117
* 1118
* 1127
* ABICOMP
* CS Indic
* CSX Indic
* CSX+ Indic
* CWI-2
* Iran System
* Kamenický
* Mazovia
* MIK

IBM AIX code pages|

* 895
* 896
* 912
* 915
* 921
* 922
* 1006
* 1008
* 1009
* 1010
* 1012
* 1013
* 1014
* 1015
* 1016
* 1017
* 1018
* 1019
* 1046
* 1133

Windows code pages|

* CER-GS
* 932
* 936 (GBK)
* 950
* Extended Latin-8
* 1250
* 1251
* 1252
* 1253
* 1254
* 1255
* 1256
* 1257
* 1258
* 1270
* Cyrillic + French
* Cyrillic + German
* Polytonic Greek

EBCDIC code pages|

* Japanese language in EBCDIC
* DKOI

DEC terminals (VTx)|

* Multinational (MCS)
* National Replacement (NRCS)
* French Canadian
* Swiss
* Spanish
* United Kingdom
* Dutch
* Finnish
* French
* Norwegian and Danish
* Swedish
* Norwegian and Danish (alternative)
* 8-bit Greek
* 8-bit Turkish
* SI 960
* Hebrew
* Special Graphics
* Technical (TCS)

Platform specific|

* 1052
* 1053
* 1054
* 1055
* 1058
* Acorn RISC OS
* Amstrad CPC
* Apple II
* ATASCII
* Atari ST
* BICS
* Casio calculators
* CDC
* Compucolor 8001
* Compucolor II
* CP/M+
* DEC RADIX 50
* DEC MCS/NRCS
* DG International
* Galaksija
* GEM
* GSM 03.38
* HP Roman
* HP FOCAL
* HP RPL
* SQUOZE
* LICS
* LMBCS
* MSX
* NEC APC
* NeXT
* PETSCII
* PostScript Standard
* PostScript Latin 1
* SAM Coupé
* Sega SC-3000
* Sharp calculators
* Sharp MZ
* Sinclair QL
* Teletext
* TI calculators
* TRS-80
* Ventura International
* WISCII
* XCCS
* ZX80
* ZX81
* ZX Spectrum

Unicode / ISO/IEC 10646|

* UTF-1
* UTF-7
* UTF-8
* UTF-16
* UTF-32
* UTF-EBCDIC
* GB 18030
* DIN 91379
* BOCU-1
* CESU-8
* SCSU
* TACE16
* Comparison of Unicode encodings

TeX typesetting system|

* Cork
* LY1
* OML
* OMS
* OT1

Miscellaneous code pages|

* ABICOMP
* ASMO 449
* Digital encoding of APL symbols
* ISO-IR-68
* ARIB STD-B24
* Fieldata
* HZ
* IEC-P27-1
* INIS
* 7-bit
* 8-bit
* ISO-IR-169
* ISO 2033
* KOI
* KOI8-R
* KOI8-RU
* KOI8-U
* Mojikyō
* SEASCII
* Stanford/ITS
* Symbol
* TRON
* Unified Hangul Code

Control character|

* Morse prosigns
* C0 and C1 control codes
* ISO/IEC 6429
* JIS X 0211
* Unicode control, format and separator characters
* Whitespace characters

Related topics|

* CCSID
* Character encodings in HTML
* Charset detection
* Han unification
* Hardware code page
* MICR code
* Mojibake
* Variable-length encoding

Character sets
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template