ZX80 character set

The ZX80 character set is the character encoding used by the Sinclair Research ZX80 microcomputer with its original 4K BASIC ROM. 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 successor ZX81.

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 or the at sign.

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 1 is the double-quote (") character when used in the display file, but uniquely to the ZX80 it is used internally as the string terminator character[1] so the BASIC function CHR$(1) returns a null string;[2] CHR$(212) translates to the printable " character.[3]

Changes in the ZX81

The 8K BASIC ROM of the follow-up ZX81 model was also available as an upgrade for the ZX80, replacing its integer-only 4K BASIC ROM.[4] It introduced the modified ZX81 character set which has 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.

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 ZX80 system font uses an 8×8 pixel-per-character grid where most glyphs fit in 7×6 pixels leaving one pixel horizontal space between them. This font was modified in the ZX81's ROM to slightly narrower 6×6 pixel glyphs with two pixels horizontal space between them, which improved the look of single inverted characters by showing inverted pixels on both sides. 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.

Layout

Legend:

  Alphabetic
  Control character
  Numeric digit
  Punctuation

  Extended punctuation
  Graphic character
  International
  Undefined

ZX80 character set[1][3][lower-alpha 1]
_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F
 
0_
 
SP
U+0020
0
"
U+0022
1[lower-alpha 2]

U+258C
2

U+2584
3

U+2598
4

U+259D
5

U+2596
6

U+2597
7

U+259E
8

U+2592
9[lower-alpha 3]


10[lower-alpha 4]


11[lower-alpha 4]
£
U+00A3
12
$
U+0024
13
:
U+003A
14
?
U+003F
15
 
1_
 
(
U+0028
16
)
U+0029
17
-
U+002D
18
+
U+002B
19
*
U+002A
20
/
U+002F
21
=
U+003D
22
>
U+003E
23
<
U+003C
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_
 
                               
 
5_
 
                               
 
6_
 
                               
 
7_
 
UP

112
DOWN

113
LEFT

114
RIGHT

115
HOME

116
EDIT

117
NEW
LINE

118
RUB
OUT

119
               
 
8_
 

U+2588
128
"

129

U+2590
130

U+2580
131

U+259F
132

U+2599
133

U+259C
134

U+259B
135

U+259A
136

U+2592
137[lower-alpha 3]


138[lower-alpha 4]


139[lower-alpha 4]
£

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_
 
                               
 
D_
 
        "

212[lower-alpha 2]
THEN

213[lower-alpha 5]
TO

214[lower-alpha 5]
;

215
,

216
(

217
)

218
NOT

219[lower-alpha 5]
-

220
+

221
*

222
/

223
 
E_
 
AND

224[lower-alpha 5]
OR

225[lower-alpha 5]
**

226[lower-alpha 6]
=

227
>

228[lower-alpha 1]
<

229[lower-alpha 1]
LIST

230[lower-alpha 5]
RETURN

231[lower-alpha 5]
CLS

232[lower-alpha 5]
DIM

233[lower-alpha 5]
SAVE

234[lower-alpha 5]
FOR

235[lower-alpha 5]
GO TO

236[lower-alpha 5]
POKE

237[lower-alpha 5]
INPUT

238[lower-alpha 5]
RAND
OMISE

239[lower-alpha 5]
 
F_
 
LET

240[lower-alpha 5]
    NEXT

243[lower-alpha 5]
PRINT

244[lower-alpha 5]
  NEW

246[lower-alpha 5]
RUN

247[lower-alpha 5]
STOP

248[lower-alpha 5]
CONT
INUE

249[lower-alpha 5]
IF

250[lower-alpha 5]
GO SUB

251[lower-alpha 5]
LOAD

252[lower-alpha 5]
CLEAR

253[lower-alpha 5]
REM

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

Notes

  1. 1 2 3 The ZX80 Operating Manual has an error and shows the > and < symbols in the wrong order.[5]
  2. 1 2 Code point 1 is the double-quote (") symbol when used in the video memory (called the display file), but it is used internally as the string terminator character[1] so CHR$(1) returns a null string. Code point 212, CHR$(212), translates to the printable " character.
  3. 1 2 Because they are 50% gray rasters, code points 9 and 137 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.
  4. 1 2 3 4 Not in the Block Elements Unicode block.
  5. 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 Sinclair BASIC tokenizes keywords into single-byte code points.
  6. The raise to a power multi-character operator tokenized into a single-byte code point.

References

See also

This article is issued from Wikipedia - version of the Wednesday, April 06, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.