Close menu

ZX80 character set


Source: http://en.wikipedia.org/wiki/ZX80_character_set
Updated: 2017-04-11T22:14Z
The Sinclair ZX80 character set rendered in the system font.

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

Screenshot of a ZX80 4K BASIC program that demonstrates all code points including BASIC keywords and nonprintable characters, the latter rendered as question marks except CHR$(1) rendered as a null string. Therefore the top line covers the 33 code points 0–32, the following 5 lines cover 32 each, and the last lines with keywords cover yet fewer.

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.

Character set

Legend:

ZX80 character set[1][3][a]
_0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F
 
0_
 
SP
U+0020
0
"
U+0022
1[b]
ZXSpectrum8a.svg
U+258C
2
ZXSpectrum8c.svg
U+2584
3
ZXSpectrum82.svg
U+2598
4
ZXSpectrum81.svg
U+259D
5
ZXSpectrum88.svg
U+2596
6
ZXSpectrum84.svg
U+2597
7
ZXSpectrum89.svg
U+259E
8
ZX80 character 0x09, ZX81 character 0x08.png
U+2592
9[c]
ZX80 character 0x0A, ZX81 character 0x09.png

10[d]
ZX80 character 0x0B, ZX81 character 0x0A.png

11[d]
£
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_
 
ZXSpectrum8f.svg
U+2588
128
"

129
ZXSpectrum85.svg
U+2590
130
ZXSpectrum83.svg
U+2580
131
ZXSpectrum8d.svg
U+259F
132
ZXSpectrum8e.svg
U+2599
133
ZXSpectrum87.svg
U+259C
134
ZXSpectrum8b.svg
U+259B
135
ZXSpectrum86.svg
U+259A
136
ZX80 character 0x89, ZX81 character 0x88.png
U+2592
137[c]
ZX80 character 0x8A, ZX81 character 0x89.png

138[d]
ZX80 character 0x8B, ZX81 character 0x8A.png

139[d]
£

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[b]
THEN

213[e]
TO

214[e]
;

215
,

216
)

217
(

218
NOT

219[e]
-

220
+

221
*

222
/

223
 
E_
 
AND

224[e]
OR

225[e]
**

226[f]
=

227
>

228[a]
<

229[a]
LIST

230[e]
RETURN

231[e]
CLS

232[e]
DIM

233[e]
SAVE

234[e]
FOR

235[e]
GO TO

236[e]
POKE

237[e]
INPUT

238[e]
RAND
OMISE

239[e]
 
F_
 
LET

240[e]
  NEXT

243[e]
PRINT

244[e]
 NEW

246[e]
RUN

247[e]
STOP

248[e]
CONT
INUE

249[e]
IF

250[e]
GO SUB

251[e]
LOAD

252[e]
CLEAR

253[e]
REM

254[e]
 
_0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F

Notes

  1. ^ a b c The ZX80 Operating Manual has an error and shows the > and < symbols in the wrong order.[5]
  2. ^ a b 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. ^ a b 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. ^ a b c d Not in the Block Elements Unicode block.
  5. ^ a b c d e f g h i j k l m n o p q r s t u v w x y z aa 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

  1. ^ a b c Wearmouth, Geoff. "An Assembly Listing of the ROM of the Sinclair ZX80". Archived from the original on August 15, 2015. 
  2. ^ Davenport, Hugo (1980). A Course in BASIC Programming - Sinclair ZX80 Operating Manual. Science of Cambridge Ltd. pp. 75–77. 
  3. ^ a b Davenport, Hugo (1980). A Course in BASIC Programming - Sinclair ZX80 Operating Manual. Science of Cambridge Ltd. pp. 116–117. 
  4. ^ "8K BASIC ROM UPGRADE". 
  5. ^ Sinclair ZX80 Character Set

See also

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.

Also On Wow

    Advertisement

    Trending Now