ZX81 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

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. Together with the 11 inverse video versions these 22 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, or into 1×2 black, white or dithered gray wide block pixels for a 32×48 resolution. The 2×2 versions of these are also present in the Block Elements Unicode block.

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

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 and 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]

In the later Sinclair 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.

System font

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. This font was modified from the one in 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.

The ZX Spectrum uses the same font as the ZX81 but adds many characters including the lowercase Latin alphabet.

Layout

Legend:

  Alphabetic
  Control character
  Numeric digit
  Punctuation

  Extended punctuation
  Graphic character
  International
  Undefined

ZX81 character set[1][3]
_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F
 
0_
 
SP
U+0020
0

U+2598
1

U+259D
2

U+2580
3

U+2596
4

U+258C
5

U+259E
6

U+259B
7

U+2592
8[lower-alpha 1]


9[lower-alpha 2]


10[lower-alpha 2]
"
U+0022
11[lower-alpha 3]
£
U+00A3
12
$
U+0024
13
:
U+003A
14
?
U+003F
15
 
1_
 
(
U+0028
16
)
U+0029
17
>
U+003E
18
<
U+003C
19
=
U+003D
20
+
U+002B
21
-
U+002D
22
*
U+002A
23
/
U+002F
24
;
U+003B
25
,
U+002C
26
.
U+002E
27
0
U+0030
28
1
U+0031
29
2
U+0032
30
3
U+0033
31
 
2_
 
4
U+0034
32
5
U+0035
33
6
U+0036
34
7
U+0037
35
8
U+0038
36
9
U+0039
37
A
U+0041
38
B
U+0042
39
C
U+0043
40
D
U+0044
41
E
U+0045
42
F
U+0046
43
G
U+0047
44
H
U+0048
45
I
U+0049
46
J
U+004A
47
 
3_
 
K
U+004B
48
L
U+004C
49
M
U+004D
50
N
U+004E
51
O
U+004F
52
P
U+0050
53
Q
U+0051
54
R
U+0052
55
S
U+0053
56
T
U+0054
57
U
U+0055
58
V
U+0056
59
W
U+0057
60
X
U+0058
61
Y
U+0059
62
Z
U+005A
63
 
4_
 
RND

64[lower-alpha 4]
INKEY$

65[lower-alpha 4]
PI

66[lower-alpha 4]
                         
 
5_
 
                               
 
6_
 
                               
 
7_
 
UP

112
DOWN

113
LEFT

114
RIGHT

115
GRAPH
ICS

116
EDIT

117
NEW
LINE

118
RUB
OUT

119
<span style="background: black; color: white; padding: 0 2px">K/<span style="background: black; color: white; padding: 0 2px">L
mode

120
FUNC
TION

121
        number
126
cursor
127
 
8_
 

U+2588
128

U+259F
129

U+2599
130

U+2584
131

U+259C
132

U+2590
133

U+259A
134

U+2597
135

U+2592
136[lower-alpha 1]


137[lower-alpha 2]


138[lower-alpha 2]
"

139
£

140
$

141
:

142
?

143
 
9_
 
(

144
)

145
>

146
<

147
=

148
+

149
-

150
*

151
/

152
;

153
,

154
.

155
0

156
1

157
2

158
3

159
 
A_
 
4

160
5

161
6

162
7

163
8

164
9

165
A

166
B

167
C

168
D

169
E

170
F

171
G

172
H

173
I

174
J

175
 
B_
 
K

176
L

177
M

178
N

179
O

180
P

181
Q

182
R

183
S

184
T

185
U

186
V

187
W

188
X

189
Y

190
Z

191
 
C_
 
""

192[lower-alpha 3]
AT

193[lower-alpha 4]
TAB

194[lower-alpha 4]
  CODE

196[lower-alpha 4]
VAL

197[lower-alpha 4]
LEN

198[lower-alpha 4]
SIN

199[lower-alpha 4]
COS

200[lower-alpha 4]
TAN

201[lower-alpha 4]
ASN

202[lower-alpha 4]
ACS

203[lower-alpha 4]
ATN

204[lower-alpha 4]
LN

205[lower-alpha 4]
EXP

206[lower-alpha 4]
INT

207[lower-alpha 4]
 
D_
 
SQR

208[lower-alpha 4]
SGN

209[lower-alpha 4]
ABS

210[lower-alpha 4]
PEEK

211[lower-alpha 4]
USR

212[lower-alpha 4]
STR$

213[lower-alpha 4]
CHR$

214[lower-alpha 4]
NOT

215[lower-alpha 4]
**

216[lower-alpha 5]
OR

217[lower-alpha 4]
AND

218[lower-alpha 4]
<=

219[lower-alpha 6]
>=

220[lower-alpha 7]
<>

221[lower-alpha 8]
THEN

222[lower-alpha 4]
TO

223[lower-alpha 4]
 
E_
 
STEP

224[lower-alpha 4]
LPRINT

225[lower-alpha 4]
LLIST

226[lower-alpha 4]
STOP

227[lower-alpha 4]
SLOW

228[lower-alpha 4]
FAST

229[lower-alpha 4]
NEW

230[lower-alpha 4]
SCROLL

231[lower-alpha 4]
CONT

232[lower-alpha 4]
DIM

233[lower-alpha 4]
REM

234[lower-alpha 4]
FOR

235[lower-alpha 4]
GOTO

236[lower-alpha 4]
GOSUB

237[lower-alpha 4]
INPUT

238[lower-alpha 4]
LOAD

239[lower-alpha 4]
 
F_
 
LIST

240[lower-alpha 4]
LET

241[lower-alpha 4]
PAUSE

242[lower-alpha 4]
NEXT

243[lower-alpha 4]
POKE

244[lower-alpha 4]
PRINT

245[lower-alpha 4]
PLOT

246[lower-alpha 4]
RUN

247[lower-alpha 4]
SAVE

248[lower-alpha 4]
RAND

249[lower-alpha 4]
IF

250[lower-alpha 4]
CLS

251[lower-alpha 4]
UNPLOT

252[lower-alpha 4]
CLEAR

253[lower-alpha 4]
RETURN

254[lower-alpha 4]
COPY

255[lower-alpha 4]
_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F

See also

Notes

  1. 1 2 Because they are 50% gray rasters, code points 8 and 136 have the same appearance although every pixel is inverted. Both can be expressed as Unicode character U+2592 ("Medium shade") in the Block Elements Unicode block, but of course if both are converted to the same code point the conversion is non-reversible.
  2. 1 2 3 4 Not in the Block Elements Unicode block.
  3. 1 2 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]
  4. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 Sinclair BASIC tokenizes keywords into single-byte code points.
  5. The raise to a power multi-character operator tokenized into a single-byte code point.
  6. The greater than or equal to multi-character operator tokenized into a single-byte code point.
  7. The less than or equal to multi-character operator tokenized into a single-byte code point.
  8. The not equal sign multi-character operator tokenized into a single-byte code point.

References

  1. 1 2 3 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.
This article is issued from Wikipedia - version of the 9/10/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.