Reference tables for terminal character sets used by retro and modern hardware.

Appendix A: ASCII Hex Table

The complete 7-bit ASCII character set (0x00-0x7F). Control characters (0x00-0x1F) and DEL (0x7F) are non-printable.

Control Characters (0x00-0x1F)

HexDecNameDescription
0x000NULNull
0x011SOHStart of Heading
0x022STXStart of Text
0x033ETXEnd of Text
0x044EOTEnd of Transmission
0x055ENQEnquiry
0x066ACKAcknowledge
0x077BELBell
0x088BSBackspace
0x099HTHorizontal Tab
0x0A10LFLine Feed
0x0B11VTVertical Tab
0x0C12FFForm Feed
0x0D13CRCarriage Return
0x0E14SOShift Out
0x0F15SIShift In
0x1016DLEData Link Escape
0x1117DC1Device Control 1 (XON)
0x1218DC2Device Control 2
0x1319DC3Device Control 3 (XOFF)
0x1420DC4Device Control 4
0x1521NAKNegative Acknowledge
0x1622SYNSynchronous Idle
0x1723ETBEnd of Trans. Block
0x1824CANCancel
0x1925EMEnd of Medium
0x1A26SUBSubstitute
0x1B27ESCEscape
0x1C28FSFile Separator
0x1D29GSGroup Separator
0x1E30RSRecord Separator
0x1F31USUnit Separator

Printable Characters (0x20-0x7E)

HexDecCharHexDecCharHexDecChar
0x2032(space)0x4064@0x6096`
0x2133!0x4165A0x6197a
0x2234"0x4266B0x6298b
0x2335#0x4367C0x6399c
0x2436$0x4468D0x64100d
0x2537%0x4569E0x65101e
0x2638&0x4670F0x66102f
0x2739'0x4771G0x67103g
0x2840(0x4872H0x68104h
0x2941)0x4973I0x69105i
0x2A42*0x4A74J0x6A106j
0x2B43+0x4B75K0x6B107k
0x2C44,0x4C76L0x6C108l
0x2D45-0x4D77M0x6D109m
0x2E46.0x4E78N0x6E110n
0x2F47/0x4F79O0x6F111o
0x304800x5080P0x70112p
0x314910x5181Q0x71113q
0x325020x5282R0x72114r
0x335130x5383S0x73115s
0x345240x5484T0x74116t
0x355350x5585U0x75117u
0x365460x5686V0x76118v
0x375570x5787W0x77119w
0x385680x5888X0x78120x
0x395790x5989Y0x79121y
0x3A58:0x5A90Z0x7A122z
0x3B59;0x5B91[0x7B123{
0x3C60<0x5C92\0x7C124|
0x3D61=0x5D93]0x7D125}
0x3E62>0x5E94^0x7E126~
0x3F63?0x5F95_0x7F127DEL
History

1963 — ASA X3.4. ASCII (American Standard Code for Information Interchange) was published in 1963 by the American Standards Association's X3.4 committee, with significant design contributions from Bob Bemer at IBM — widely credited as "the father of ASCII" for proposing the escape character, the backslash, and the case-toggle bit alignment. The committee was a cross-vendor effort (Teletype, IBM, AT&T, Burroughs, RCA, and others) and its task was to replace a patchwork of incompatible 5-bit teleprinter codes (Baudot/ITA2), 6-bit military codes (FIELDATA), and IBM's own 6-bit BCDIC. The first published version had only uppercase letters; lowercase was added in the 1967 revision (USASCII), which is the table you see above.

The 7-bit choice. Seven bits was a compromise: 6 bits couldn't fit upper- and lowercase plus digits and punctuation, while 8 bits would have wasted a bit on serial lines that already paid for a parity bit. The 8th bit (0x80-0xFF) was originally a parity bit, which is why ASCII proper stops at 0x7F — the upper half was reserved for transmission integrity, not characters. This is also why so many later codepages (Latin-1, PETSCII, ATASCII) bolt their additions onto 0x80-0xFF: that range was free real estate once parity moved out of band.

Why DEL is at 0x7F. DEL (delete) sits at 0x7F — all seven bits set — because on paper tape you "deleted" a character by punching all seven holes through it. There was no way to un-punch a hole, so the convention was to over-punch the position to a known sentinel. 0x00 (NUL) and 0x7F (DEL) are the two values that look "blank" on punched tape: NUL is no holes, DEL is all holes.

Internationalization and the 1980s. ISO 646 (first edition 1973) generalized ASCII as a national-variant standard: countries could replace 12 specific positions (notably 0x23, 0x24, 0x40, 0x5B-0x5E, 0x60, 0x7B-0x7E) with their own letters. The German variant (DIN 66003) put Ä at 0x5B (where [ is in ASCII) and ä at 0x7B (where { is); the French variant (AFNOR NF Z 62-010) put à at 0x40 (where @ is) and é at 0x7B (where { is); and so on — which is why C source code from that era sometimes contains alarming-looking accented characters in place of the punctuation the language actually wanted. ISO 8859-1 (Latin-1, 1987) and finally Unicode/UTF-8 (1992) ended the variant chaos by giving every script its own codepoint.

Today. ASCII is still the lingua franca: UTF-8 was deliberately designed so that any 7-bit ASCII file is also a valid UTF-8 file with identical bytes. Every modern text format — HTTP, email headers, JSON, source code — is ASCII-compatible at the byte level. You're reading ASCII right now.

Appendix B: ANSI Escape Sequences

ANSI escape sequences are used to control text formatting, colors, and cursor positioning on compatible terminals. All sequences begin with the escape character (0x1B) followed by a left bracket '[', known as the Control Sequence Introducer (CSI).

Sequence Format

The general format is: ESC [ <parameters> <command>

Where ESC is 0x1B (decimal 27), parameters are optional numbers separated by semicolons, and the command is a single letter.

Cursor Control

SequenceNameDescription
ESC[HCUPCursor Home - Move cursor to row 1, column 1
ESC[n;mHCUPCursor Position - Move cursor to row n, column m
ESC[n;mfHVPHorizontal Vertical Position - Same as CUP
ESC[nACUUCursor Up - Move cursor up n rows (default 1)
ESC[nBCUDCursor Down - Move cursor down n rows (default 1)
ESC[nCCUFCursor Forward - Move cursor right n columns (default 1)
ESC[nDCUBCursor Back - Move cursor left n columns (default 1)
ESC[nECNLCursor Next Line - Move to beginning of line n down
ESC[nFCPLCursor Previous Line - Move to beginning of line n up
ESC[nGCHACursor Horizontal Absolute - Move to column n
ESC[6nDSRDevice Status Report - Reports cursor position as ESC[n;mR
ESC[sSCPSave Cursor Position
ESC[uRCPRestore Cursor Position
ESC 7DECSCSave Cursor (DEC private)
ESC 8DECRCRestore Cursor (DEC private)

Erase Functions

SequenceNameDescription
ESC[JEDErase Display - Clear from cursor to end of screen
ESC[0JEDErase Display - Clear from cursor to end of screen
ESC[1JEDErase Display - Clear from beginning of screen to cursor
ESC[2JEDErase Display - Clear entire screen
ESC[3JEDErase Display - Clear entire screen and scrollback buffer
ESC[KELErase Line - Clear from cursor to end of line
ESC[0KELErase Line - Clear from cursor to end of line
ESC[1KELErase Line - Clear from beginning of line to cursor
ESC[2KELErase Line - Clear entire line

Text Attributes (SGR - Select Graphic Rendition)

Format: ESC[nm or ESC[n;n;...m for multiple attributes

CodeNameDescription
0ResetReset all attributes to default
1BoldBold or increased intensity
2DimFaint or decreased intensity
3ItalicItalic (not widely supported)
4UnderlineUnderlined text
5BlinkSlow blink (less than 150 per minute)
6Rapid BlinkRapid blink (150+ per minute, rarely supported)
7ReverseSwap foreground and background colors
8HiddenConcealed/invisible text
9StrikethroughCrossed-out text
21Double UnderlineDouble underlined (or bold off on some terminals)
22Normal IntensityNeither bold nor dim
23Not ItalicDisable italic
24Not UnderlinedDisable underline
25Not BlinkingDisable blink
27Not ReversedDisable reverse video
28RevealDisable hidden
29Not StrikethroughDisable strikethrough

Standard Foreground Colors (30-37)

CodeColorCodeColor (Bright/Bold)
30Black90Bright Black (Gray)
31Red91Bright Red
32Green92Bright Green
33Yellow93Bright Yellow
34Blue94Bright Blue
35Magenta95Bright Magenta
36Cyan96Bright Cyan
37White97Bright White
39DefaultReset to default foreground

Standard Background Colors (40-47)

CodeColorCodeColor (Bright)
40Black100Bright Black (Gray)
41Red101Bright Red
42Green102Bright Green
43Yellow103Bright Yellow
44Blue104Bright Blue
45Magenta105Bright Magenta
46Cyan106Bright Cyan
47White107Bright White
49DefaultReset to default background

256-Color Mode

Extended color support using 256-color palette:

SequenceDescription
ESC[38;5;nmSet foreground to color n (0-255)
ESC[48;5;nmSet background to color n (0-255)

Color ranges:

24-bit True Color Mode

SequenceDescription
ESC[38;2;r;g;bmSet foreground to RGB color (0-255 each)
ESC[48;2;r;g;bmSet background to RGB color (0-255 each)

Screen Modes

SequenceDescription
ESC[?25hShow cursor (DECTCEM)
ESC[?25lHide cursor (DECTCEM)
ESC[?47hSave screen and switch to alternate buffer
ESC[?47lRestore screen from alternate buffer
ESC[?1049hEnable alternate screen buffer (saves cursor too)
ESC[?1049lDisable alternate screen buffer (restores cursor)
ESC[?7hEnable line wrapping
ESC[?7lDisable line wrapping

Scrolling

SequenceDescription
ESC[nSScroll up n lines (default 1)
ESC[nTScroll down n lines (default 1)
ESC[t;brSet scrolling region from line t to line b

Line and Character Operations

SequenceDescription
ESC[nLInsert n blank lines at cursor position
ESC[nMDelete n lines starting at cursor position
ESC[n@Insert n blank characters at cursor position
ESC[nPDelete n characters at cursor position
ESC[nXErase n characters at cursor position

Common Escape Sequences Quick Reference

SequenceHex BytesDescription
ESC[2J1B 5B 32 4AClear entire screen
ESC[H1B 5B 48Move cursor to home (1,1)
ESC[2J ESC[H1B 5B 32 4A 1B 5B 48Clear screen and home cursor
ESC[0m1B 5B 30 6DReset all attributes
ESC[1m1B 5B 31 6DBold on
ESC[31m1B 5B 33 31 6DRed foreground
ESC[44m1B 5B 34 34 6DBlue background
ESC[1;31m1B 5B 31 3B 33 31 6DBold red foreground
ESC[?25l1B 5B 3F 32 35 6CHide cursor
ESC[?25h1B 5B 3F 32 35 68Show cursor

C0 Control Characters Used with ANSI

HexDecNameDescription
0x077BELBell - Terminal bell/alert
0x088BSBackspace - Move cursor left one position
0x099HTHorizontal Tab - Move to next tab stop
0x0A10LFLine Feed - Move cursor down one line
0x0B11VTVertical Tab - Move cursor down (treated as LF)
0x0C12FFForm Feed - Clear screen on some terminals
0x0D13CRCarriage Return - Move cursor to column 1
0x1B27ESCEscape - Starts escape sequences
Note: "ANSI escape codes" is colloquial. The actual standard is ECMA-48 (1976, fifth edition 1991) — later adopted as ISO/IEC 6429 and as the now-withdrawn ANSI X3.64. Support varies between emulators; the de-facto reference is the DEC VT100 family. Ethernet Gateway uses a subset for screen clearing (ESC[2J ESC[H), cursor positioning, and color output on ANSI terminals.
History

Pre-history: ASCII control codes weren't enough. The 33 ASCII control codes (0x00-0x1F plus 0x7F) cover the basics — CR, LF, BEL, BS, TAB — but they have no way to say "move the cursor to row 5 column 12" or "draw the next word in red." Early CRT terminals (the ADM-3A, the Hazeltine 1500, the Lear-Siegler) each invented their own escape sequences, and none of them agreed. Software either had to ship a termcap database with hundreds of entries or be limited to the lowest common denominator.

1976 — ECMA-48. The European Computer Manufacturers Association published ECMA-48: Control Functions for Coded Character Sets in 1976 to standardize the soup. It defined the Control Sequence Introducer (CSI = ESC [), the parameter format, the cursor-motion command set, and Select Graphic Rendition (SGR) for text attributes. ANSI adopted it as X3.64 in 1979, and ISO as ISO/IEC 6429 in 1983. ANSI X3.64 was withdrawn in 1997, but the "ANSI" name stuck because that's what U.S. terminal manuals called it.

1978 — the DEC VT100. Digital Equipment Corporation shipped the VT100, an early microprocessor-based terminal that implemented an ANSI-conformant subset (with some DEC-private extensions like DECSC/DECRC and the scrolling region). The VT100 became so dominant that "VT100-compatible" became the practical definition of an ANSI terminal. Its successors — VT102, VT220, VT320, VT420 — layered on more features (8-bit codes, soft fonts, sixel graphics) but stayed compatible. To this day, when you tell ssh or screen your terminal type, you're probably saying xterm or vt100.

The xterm era. xterm was originally written at MIT in 1984 by Mark Vandevoorde (initially for the VS100 stand-alone terminal) and then ported to the X Window System by Jim Gettys, who maintained and extended it for decades. It implemented VT102 emulation faithfully and then kept adding features: 256-color mode (1999, via the ESC[38;5;nm extension), 24-bit truecolor (ESC[38;2;r;g;bm), mouse reporting, bracketed paste, OSC 52 clipboard. Modern terminals (iTerm2, Alacritty, kitty, Windows Terminal, GNOME Terminal) all implement the xterm extension set, often with their own additions. There is no committee shepherding this anymore — the de facto standard is "what xterm does."

Today. ANSI escape sequences run the modern terminal: every TUI tool (vim, htop, tmux, fzf), every CI log with colored output, every progress bar, every git diff. Windows finally added native ANSI/VT support to its console host in Windows 10 (Threshold 2, late 2015), opt-in via the ENABLE_VIRTUAL_TERMINAL_PROCESSING mode flag, ending decades of having to ship an ANSI-to-Win32-Console translator like ANSICON; the modern Windows Terminal app (2019) made it the default. The single biggest practical limitation is still which extensions a given terminal implements — truecolor support, in particular, varies wildly across SSH-into-tmux-into-screen chains.

Appendix C: PETSCII Hex Table

The Commodore 64 PETSCII character set. PETSCII differs from ASCII in several ways: control codes, graphics characters, and case handling (uppercase/lowercase are swapped compared to standard ASCII).

PETSCII Control Characters (0x00-0x1F)

HexDecNameDescription
0x000-(Unused)
0x011-(Unused)
0x022-(Unused)
0x033STOPRun/Stop
0x044-(Unused)
0x055WHTWhite
0x066-(Unused)
0x077BELLBell
0x088DISHDisable Shift+C=
0x099ENSHEnable Shift+C=
0x0A10-(Unused)
0x0B11-(Unused)
0x0C12-(Unused)
0x0D13CRCarriage Return
0x0E14LOWRSwitch to Lowercase
0x0F15-(Unused)
0x1016-(Unused)
0x1117DOWNCursor Down
0x1218RVONReverse On
0x1319HOMECursor Home
0x1420DELDelete (Backspace)
0x1521-(Unused)
0x1622-(Unused)
0x1723-(Unused)
0x1824-(Unused)
0x1925-(Unused)
0x1A26-(Unused)
0x1B27-(Unused - no native ESC)
0x1C28REDRed
0x1D29RIGHTCursor Right
0x1E30GRNGreen
0x1F31BLUBlue

PETSCII Printable Characters (0x20-0x3F)

HexDecCharDescription
0x2032(space)Space
0x2133!Exclamation Mark
0x2234"Quotation Mark
0x2335#Number Sign
0x2436$Dollar Sign
0x2537%Percent Sign
0x2638&Ampersand
0x2739'Apostrophe
0x2840(Left Parenthesis
0x2941)Right Parenthesis
0x2A42*Asterisk
0x2B43+Plus Sign
0x2C44,Comma
0x2D45-Hyphen-Minus
0x2E46.Full Stop
0x2F47/Solidus (Slash)
0x30480Digit Zero
0x31491Digit One
0x32502Digit Two
0x33513Digit Three
0x34524Digit Four
0x35535Digit Five
0x36546Digit Six
0x37557Digit Seven
0x38568Digit Eight
0x39579Digit Nine
0x3A58:Colon
0x3B59;Semicolon
0x3C60<Less-Than Sign
0x3D61=Equals Sign
0x3E62>Greater-Than Sign
0x3F63?Question Mark

PETSCII Uppercase Letters (0x40-0x5F)

Note: In PETSCII uppercase mode, these are uppercase letters. In lowercase mode, these become graphics characters.

HexDecCharDescription
0x4064@Commercial At
0x4165ALatin Capital Letter A
0x4266BLatin Capital Letter B
0x4367CLatin Capital Letter C
0x4468DLatin Capital Letter D
0x4569ELatin Capital Letter E
0x4670FLatin Capital Letter F
0x4771GLatin Capital Letter G
0x4872HLatin Capital Letter H
0x4973ILatin Capital Letter I
0x4A74JLatin Capital Letter J
0x4B75KLatin Capital Letter K
0x4C76LLatin Capital Letter L
0x4D77MLatin Capital Letter M
0x4E78NLatin Capital Letter N
0x4F79OLatin Capital Letter O
0x5080PLatin Capital Letter P
0x5181QLatin Capital Letter Q
0x5282RLatin Capital Letter R
0x5383SLatin Capital Letter S
0x5484TLatin Capital Letter T
0x5585ULatin Capital Letter U
0x5686VLatin Capital Letter V
0x5787WLatin Capital Letter W
0x5888XLatin Capital Letter X
0x5989YLatin Capital Letter Y
0x5A90ZLatin Capital Letter Z
0x5B91[Left Square Bracket
0x5C92£Pound Sign
0x5D93]Right Square Bracket
0x5E94Up Arrow
0x5F95Left Arrow (used as ESC equivalent)

PETSCII Graphics/Lowercase (0x60-0x7F)

Note: In uppercase mode, these are graphics characters. In lowercase mode, 0x61-0x7A become lowercase letters.

HexDecUpper ModeLower Mode
0x6096Horizontal LineHorizontal Line
0x6197Spadea
0x6298Vertical Line Leftb
0x6399Horizontal Line Bottomc
0x64100Horizontal Line Top/Bottomd
0x65101Horizontal Line Tope
0x66102Vertical Line Right Topf
0x67103Vertical Line Right Bottomg
0x68104Vertical Line Left Bottomh
0x69105Corner Round Right Bottomi
0x6A106Corner Round Right Topj
0x6B107Corner Round Left Topk
0x6C108Half Block Bottom Rightl
0x6D109Corner Round Left Bottomm
0x6E110Half Block Upper Rightn
0x6F111Half Block Lower Lefto
0x70112Half Block Lower Rightp
0x71113Circleq
0x72114Half Block Upper Leftr
0x73115Hearts
0x74116Vertical Line Left Topt
0x75117Crossu
0x76118Diamondv
0x77119Crossw
0x78120Vertical Linex
0x79121Cluby
0x7A122Vertical Line Rightz
0x7B123CrossCross
0x7C124Half Block UpperHalf Block Upper
0x7D125Pi SymbolPi Symbol
0x7E126Half Block LowerHalf Block Lower
0x7F127Half Block LeftHalf Block Left

PETSCII High Control Characters (0x80-0x9F)

HexDecNameDescription
0x80128-(Unused)
0x81129ORGOrange
0x82130-(Unused)
0x83131-(Unused)
0x84132-(Unused)
0x85133F1Function Key 1
0x86134F3Function Key 3
0x87135F5Function Key 5
0x88136F7Function Key 7
0x89137F2Function Key 2
0x8A138F4Function Key 4
0x8B139F6Function Key 6
0x8C140F8Function Key 8
0x8D141SHRETShift+Return
0x8E142UPPRSwitch to Uppercase
0x8F143-(Unused)
0x90144BLKBlack
0x91145UPCursor Up
0x92146RVOFReverse Off
0x93147CLRClear Screen
0x94148INSTInsert
0x95149BRNBrown
0x96150LTRDLight Red (Pink)
0x97151GRY1Dark Gray
0x98152GRY2Medium Gray
0x99153LTGRLight Green
0x9A154LTBLLight Blue
0x9B155GRY3Light Gray
0x9C156PURPurple
0x9D157LEFTCursor Left
0x9E158YELYellow
0x9F159CYNCyan

PETSCII Shifted Graphics (0xA0-0xBF)

HexDecDescription
0xA0160Shifted Space
0xA1161Vertical Bar Left
0xA2162Horizontal Bar Bottom
0xA3163Horizontal Bar Top
0xA4164Horizontal Bar
0xA5165Horizontal Bar Left
0xA6166Checkerboard
0xA7167Vertical Bar Right
0xA8168Vertical Bar Bottom
0xA9169Corner Lower Right
0xAA170Corner Upper Right
0xAB171Corner Upper Left
0xAC172Quarter Block Lower Right
0xAD173Corner Lower Left
0xAE174Quarter Block Upper Right
0xAF175Quarter Block Lower Left
0xB0176Quarter Block Lower Right
0xB1177Vertical Bar Left Bottom
0xB2178Quarter Block Upper Left
0xB3179Vertical Bar Top
0xB4180Vertical Bar Bottom
0xB5181T Junction Left
0xB6182Vertical Bar
0xB7183T Junction Top
0xB8184T Junction Bottom
0xB9185Half Block Right
0xBA186T Junction Right
0xBB187Cross Junction
0xBC188Upper Half Block
0xBD189Pi Symbol
0xBE190Lower Half Block
0xBF191Half Block Left

PETSCII Shifted Letters/Graphics (0xC0-0xDF)

Note: In uppercase mode, these match 0x60-0x7F graphics. In lowercase mode, 0xC1-0xDA are uppercase letters.

HexDecUpper ModeLower Mode
0xC0192Horizontal LineHorizontal Line
0xC1193SpadeA
0xC2194Vertical Line LeftB
0xC3195Horizontal Line BottomC
0xC4196Line HorizontalD
0xC5197Horizontal Line TopE
0xC6198Vertical Line Right TopF
0xC7199Vertical Line Right BottomG
0xC8200Vertical Line Left BottomH
0xC9201Corner Round Right BottomI
0xCA202Corner Round Right TopJ
0xCB203Corner Round Left TopK
0xCC204Half Block Bottom RightL
0xCD205Corner Round Left BottomM
0xCE206Half Block Upper RightN
0xCF207Half Block Lower LeftO
0xD0208Half Block Lower RightP
0xD1209CircleQ
0xD2210Half Block Upper LeftR
0xD3211HeartS
0xD4212Vertical Line Left TopT
0xD5213CrossU
0xD6214DiamondV
0xD7215CrossW
0xD8216Vertical LineX
0xD9217ClubY
0xDA218Vertical Line RightZ
0xDB219CrossCross
0xDC220Half Block UpperHalf Block Upper
0xDD221Pi SymbolPi Symbol
0xDE222Half Block LowerHalf Block Lower
0xDF223Half Block LeftHalf Block Left

PETSCII High Graphics (0xE0-0xFF)

HexDecDescription
0xE0224Shifted Space
0xE1225Vertical Bar Left
0xE2226Horizontal Bar Bottom
0xE3227Horizontal Bar Top
0xE4228Horizontal Bar
0xE5229Horizontal Bar Left
0xE6230Checkerboard
0xE7231Vertical Bar Right
0xE8232Vertical Bar Bottom
0xE9233Corner Lower Right
0xEA234Corner Upper Right
0xEB235Corner Upper Left
0xEC236Quarter Block Lower Right
0xED237Corner Lower Left
0xEE238Quarter Block Upper Right
0xEF239Quarter Block Lower Left
0xF0240Quarter Block Lower Right
0xF1241Vertical Bar Left Bottom
0xF2242Quarter Block Upper Left
0xF3243Vertical Bar Top
0xF4244Vertical Bar Bottom
0xF5245T Junction Left
0xF6246Vertical Bar
0xF7247T Junction Top
0xF8248T Junction Bottom
0xF9249Half Block Right
0xFA250T Junction Right
0xFB251Cross Junction
0xFC252Upper Half Block
0xFD253Pi Symbol
0xFE254Lower Half Block
0xFF255Half Block Left
Note: PETSCII has two character modes controlled by codes 0x0E (lowercase mode) and 0x8E (uppercase mode). In uppercase mode, codes 0x41-0x5A display uppercase letters and codes 0x61-0x7A display graphics. In lowercase mode, 0x41-0x5A display lowercase letters and 0x61-0x7A display uppercase letters. Ethernet Gateway swaps case in software for PETSCII output (see send() / send_line()) so the same uppercase-by-default logic works on a C64 in either character mode.
History

1977 — the Commodore PET. PETSCII (PET Standard Code of Information Interchange) was designed for the Commodore PET 2001, unveiled at the Winter CES in January 1977 and shipped in volume that October — making it, alongside the Apple II and the TRS-80, one of the "1977 Trinity" of consumer personal computers. Commodore engineer Chuck Peddle — who had led the 6502 CPU design at MOS Technology before Commodore acquired the chipmaker — was the architect of the PET. PETSCII was based on ASCII but extended with a full set of monochrome block-graphics characters, chosen so that the PET could draw boxes, charts, and simple game graphics without a separate graphics chip.

The case-swap quirk. PETSCII has two display modes selected by sending 0x8E (uppercase mode, the boot default) or 0x0E (lowercase mode). In uppercase mode, codes 0x41-0x5A render as A-Z (matching ASCII visually) and codes 0x61-0x7A render as graphics characters. In lowercase mode, the same bytes flip: 0x41-0x5A render as lowercase a-z, and 0x61-0x7A render as uppercase A-Z — effectively swapped from ASCII. The net effect is that any ASCII text printed verbatim on a C64 in lowercase mode comes out CASE-INVERTED. Every BBS terminal, every cross-platform tool, every emulator handles this differently. Ethernet Gateway swaps case in software so a telnet user on a C64 sees the right thing without configuration.

The shared-platform legacy. PETSCII outlived the PET. It carried over with minor adjustments to the VIC-20 (1980), the Commodore 64 (1982, which sold ~17 million units — the best-selling single computer model in history), the C128 (1985), and the Plus/4 and C16 (1984). Color codes (0x05, 0x1C-0x1F, 0x81, 0x90-0x9F) were added on color-capable models; the PET itself was monochrome and ignored them.

Reverse-video and cursor codes inline. Unlike ANSI, PETSCII doesn't use multi-byte escape sequences: every effect is a single byte. 0x12 turns reverse video on, 0x92 turns it off; 0x11/0x91/0x1D/0x9D are cursor down/up/ right/left; 0x93 clears the screen; 0x0E/0x8E switch case mode. This made it trivial to print formatted text from BASIC (PRINT CHR$(147) = clear screen) but means PETSCII files are not portable to ANSI terminals without translation.

Still alive in the BBS scene. PETSCII never died. The Commodore BBS scene of the 1980s is still active: dozens of PETSCII boards run today on real hardware (via WiFi modem cartridges like the WiFi Modem 232 and the Userport Hub) or in emulators, dialing each other up via telnet. Modern PETSCII art has its own demoscene, and tools like petmate and PETSCII Editor target both retro hardware and modern displays. Ethernet Gateway's PETSCII support exists specifically so a real C64 with a WiFi modem can use a modern telnet/SSH gateway as if it were a 1985-era BBS.

Appendix D: ATASCII Hex Table

The ATASCII character set used by Atari 8-bit computers (400, 800, XL, XE series). ATASCII is similar to ASCII but has unique control codes and graphics characters. Codes 0x80-0xFF are inverse video versions of 0x00-0x7F.

ATASCII Control Characters (0x00-0x1F)

HexDecNameDescription
0x000-(Null/Heart graphics)
0x011-(Ctrl+A graphics)
0x022-(Ctrl+B graphics)
0x033-(Ctrl+C graphics)
0x044-(Ctrl+D graphics)
0x055-(Ctrl+E graphics)
0x066-(Ctrl+F graphics)
0x077BELLBell (buzzer)
0x088-(Ctrl+H graphics)
0x099-(Ctrl+I graphics)
0x0A10-(Ctrl+J graphics)
0x0B11-(Ctrl+K graphics)
0x0C12-(Ctrl+L graphics)
0x0D13-(Ctrl+M graphics)
0x0E14-(Ctrl+N graphics)
0x0F15-(Ctrl+O graphics)
0x1016-(Ctrl+P graphics)
0x1117-(Ctrl+Q graphics)
0x1218-(Ctrl+R graphics)
0x1319-(Ctrl+S graphics)
0x1420-(Ctrl+T graphics)
0x1521-(Ctrl+U graphics)
0x1622-(Ctrl+V graphics)
0x1723-(Ctrl+W graphics)
0x1824-(Ctrl+X graphics)
0x1925-(Ctrl+Y graphics)
0x1A26-(Ctrl+Z graphics)
0x1B27ESCEscape
0x1C28UPCursor Up
0x1D29DOWNCursor Down
0x1E30LEFTCursor Left
0x1F31RIGHTCursor Right

ATASCII Printable Characters (0x20-0x5F)

HexDecCharHexDecChar
0x2032(space)0x4064@
0x2133!0x4165A
0x2234"0x4266B
0x2335#0x4367C
0x2436$0x4468D
0x2537%0x4569E
0x2638&0x4670F
0x2739'0x4771G
0x2840(0x4872H
0x2941)0x4973I
0x2A42*0x4A74J
0x2B43+0x4B75K
0x2C44,0x4C76L
0x2D45-0x4D77M
0x2E46.0x4E78N
0x2F47/0x4F79O
0x304800x5080P
0x314910x5181Q
0x325020x5282R
0x335130x5383S
0x345240x5484T
0x355350x5585U
0x365460x5686V
0x375570x5787W
0x385680x5888X
0x395790x5989Y
0x3A58:0x5A90Z
0x3B59;0x5B91[
0x3C60<0x5C92\
0x3D61=0x5D93]
0x3E62>0x5E94^
0x3F63?0x5F95_

ATASCII Lowercase and Graphics (0x60-0x7F)

HexDecCharDescription
0x6096Diamond
0x6197aLowercase a
0x6298bLowercase b
0x6399cLowercase c
0x64100dLowercase d
0x65101eLowercase e
0x66102fLowercase f
0x67103gLowercase g
0x68104hLowercase h
0x69105iLowercase i
0x6A106jLowercase j
0x6B107kLowercase k
0x6C108lLowercase l
0x6D109mLowercase m
0x6E110nLowercase n
0x6F111oLowercase o
0x70112pLowercase p
0x71113qLowercase q
0x72114rLowercase r
0x73115sLowercase s
0x74116tLowercase t
0x75117uLowercase u
0x76118vLowercase v
0x77119wLowercase w
0x78120xLowercase x
0x79121yLowercase y
0x7A122zLowercase z
0x7B123Spade
0x7C124|Vertical Bar
0x7D125CLRClear Screen
0x7E126BSBackspace
0x7F127TABTab

ATASCII Inverse Control Characters (0x80-0x9F)

These are inverse video versions of 0x00-0x1F graphics characters.

HexDecNameDescription
0x80128-Inverse Heart
0x81129-Inverse Ctrl+A
0x82130-Inverse Ctrl+B
0x83131-Inverse Ctrl+C
0x84132-Inverse Ctrl+D
0x85133-Inverse Ctrl+E
0x86134-Inverse Ctrl+F
0x87135-Inverse Ctrl+G
0x88136-Inverse Ctrl+H
0x89137-Inverse Ctrl+I
0x8A138-Inverse Ctrl+J
0x8B139-Inverse Ctrl+K
0x8C140-Inverse Ctrl+L
0x8D141-Inverse Ctrl+M
0x8E142-Inverse Ctrl+N
0x8F143-Inverse Ctrl+O
0x90144-Inverse Ctrl+P
0x91145-Inverse Ctrl+Q
0x92146-Inverse Ctrl+R
0x93147-Inverse Ctrl+S
0x94148-Inverse Ctrl+T
0x95149-Inverse Ctrl+U
0x96150-Inverse Ctrl+V
0x97151-Inverse Ctrl+W
0x98152-Inverse Ctrl+X
0x99153-Inverse Ctrl+Y
0x9A154-Inverse Ctrl+Z
0x9B155EOLEnd of Line (Return)
0x9C156DELLNDelete Line
0x9D157INSLNInsert Line
0x9E158CLRTABClear Tab Stop
0x9F159SETTABSet Tab Stop

ATASCII Inverse Printable Characters (0xA0-0xDF)

These are inverse video versions of 0x20-0x5F.

HexDecCharHexDecChar
0xA0160Inv (space)0xC0192Inv @
0xA1161Inv !0xC1193Inv A
0xA2162Inv "0xC2194Inv B
0xA3163Inv #0xC3195Inv C
0xA4164Inv $0xC4196Inv D
0xA5165Inv %0xC5197Inv E
0xA6166Inv &0xC6198Inv F
0xA7167Inv '0xC7199Inv G
0xA8168Inv (0xC8200Inv H
0xA9169Inv )0xC9201Inv I
0xAA170Inv *0xCA202Inv J
0xAB171Inv +0xCB203Inv K
0xAC172Inv ,0xCC204Inv L
0xAD173Inv -0xCD205Inv M
0xAE174Inv .0xCE206Inv N
0xAF175Inv /0xCF207Inv O
0xB0176Inv 00xD0208Inv P
0xB1177Inv 10xD1209Inv Q
0xB2178Inv 20xD2210Inv R
0xB3179Inv 30xD3211Inv S
0xB4180Inv 40xD4212Inv T
0xB5181Inv 50xD5213Inv U
0xB6182Inv 60xD6214Inv V
0xB7183Inv 70xD7215Inv W
0xB8184Inv 80xD8216Inv X
0xB9185Inv 90xD9217Inv Y
0xBA186Inv :0xDA218Inv Z
0xBB187Inv ;0xDB219Inv [
0xBC188Inv <0xDC220Inv \
0xBD189Inv =0xDD221Inv ]
0xBE190Inv >0xDE222Inv ^
0xBF191Inv ?0xDF223Inv _

ATASCII Inverse Lowercase and Graphics (0xE0-0xFF)

These are inverse video versions of 0x60-0x7F.

HexDecCharDescription
0xE0224Inv ♦Inverse Diamond
0xE1225Inv aInverse Lowercase a
0xE2226Inv bInverse Lowercase b
0xE3227Inv cInverse Lowercase c
0xE4228Inv dInverse Lowercase d
0xE5229Inv eInverse Lowercase e
0xE6230Inv fInverse Lowercase f
0xE7231Inv gInverse Lowercase g
0xE8232Inv hInverse Lowercase h
0xE9233Inv iInverse Lowercase i
0xEA234Inv jInverse Lowercase j
0xEB235Inv kInverse Lowercase k
0xEC236Inv lInverse Lowercase l
0xED237Inv mInverse Lowercase m
0xEE238Inv nInverse Lowercase n
0xEF239Inv oInverse Lowercase o
0xF0240Inv pInverse Lowercase p
0xF1241Inv qInverse Lowercase q
0xF2242Inv rInverse Lowercase r
0xF3243Inv sInverse Lowercase s
0xF4244Inv tInverse Lowercase t
0xF5245Inv uInverse Lowercase u
0xF6246Inv vInverse Lowercase v
0xF7247Inv wInverse Lowercase w
0xF8248Inv xInverse Lowercase x
0xF9249Inv yInverse Lowercase y
0xFA250Inv zInverse Lowercase z
0xFB251Inv ♠Inverse Spade
0xFC252Inv |Inverse Vertical Bar
0xFD253BELLBell (buzzer)
0xFE254DELDelete Character
0xFF255INSInsert Character

Key ATASCII Codes Reference

FunctionHexDecNotes
Escape0x1B27Same as ASCII
Return/EOL0x9B155End of logical line
Backspace0x7E126Delete character left
Delete0xFE254Delete character at cursor
Insert0xFF255Insert mode toggle
Clear Screen0x7D125Clear and home cursor
Cursor Up0x1C28
Cursor Down0x1D29
Cursor Left0x1E30
Cursor Right0x1F31
Tab0x7F127Move to next tab stop
Bell0xFD253Also 0x07
Delete Line0x9C156
Insert Line0x9D157
Note: ATASCII uses 0x9B (155) for end-of-line instead of the standard ASCII 0x0D (13). The upper 128 characters (0x80-0xFF) are inverse video versions of the lower 128 (0x00-0x7F), except for certain control codes in the 0x9B-0x9F and 0xFD-0xFF ranges which have special functions.
History

1979 — the Atari 400 and 800. ATASCII (Atari Standard Code for Information Interchange) was introduced with the Atari 400 and 800 in November 1979 — the same year as the TI-99/4. The character set was designed by Atari's Home Computer Division under Jay Miner, who would later design the Amiga's custom chips. The Atari 8-bits (400/800/1200XL/600XL/800XL/65XE/130XE/XEGS) all used ATASCII unchanged from 1979 to the line's discontinuation in 1992 — an unusually long character-set lifetime for a home-computer family.

The 0x9B EOL problem. ATASCII's most infamous quirk is using 0x9B (155, "EOL") as end-of-line instead of CR/LF. This was a deliberate choice — 0x9B is a single byte, doesn't require pairing CR with LF, and falls in a range Atari considered "safe" because they didn't use the 0x80-0xFF inverse range for printable text. The downside was severe: every cross-platform file transfer (ASCII mode FTP, BBS uploads, modem terminal programs) had to translate 0x9B to 0x0D 0x0A on the way out and back on the way in. A generation of Atari users learned what "ATASCII translation" meant the hard way after losing line breaks on cross-platform files. The Ethernet Gateway's terminal-detection logic specifically watches for ATASCII-style line endings.

Inverse video as a parallel character set. The Atari ANTIC graphics chip rendered character cells with a hardware inverse-video bit (bit 7 of the screen-memory byte). ATASCII exploits this directly: the upper 128 codes (0x80-0xFF) are not new characters — they're the lower 128 with inverse video applied. This means an Atari programmer could highlight a word in a status line by simply ORing 0x80 into each byte. Six positions (0x9B-0x9F, 0xFD-0xFF) were stolen back as control codes (EOL, delete-line, insert-line, tab-stop set/clear, bell, delete-char, insert-char), so those don't have inverse equivalents.

The Atari BBS scene. Atari BBSes (running software like AMIS, FoReM, BBS Express!) were a parallel ecosystem to the Commodore boards. ATASCII art and animations — using the cursor-control codes to move around and the inverse-video range for color — were a recognizable style, distinct from PETSCII or ANSI art. Commercial online services that catered to Atari users included The Source (a Reader's Digest subsidiary, later acquired by CompuServe) and CompuServe itself, both of which published Atari-specific terminal programs that translated ATASCII to and from ASCII at the gateway.

Today. ATASCII survives in emulators (Altirra, Atari800), in modern cartridges and SD-based loaders that let real 8-bit hardware connect to modern networks (FujiNet, SIO2PC), and in the small but persistent Atari demoscene. The character set is also still used by some specialty software for Atari ST and Falcon machines that retained 8-bit-mode compatibility.

Appendix E: Baudot (ITA2) Code Table

Emile Baudot devised his 5-bit telegraph encoding in the 1870s. The CCITT adopted a refined version as International Telegraph Alphabet No. 2 (ITA2) in 1932, and it remained the standard teleprinter code worldwide until ASCII took over in the 1960s. The unit of signaling speed, the "baud," takes its name from Baudot.

How Baudot Works

With only 5 bits, Baudot can represent 32 unique codes (0-31). To encode letters, numbers, and punctuation, Baudot uses two "shift" states:

The receiver maintains the current shift state. Sending LTRS (code 31) or FIGS (code 27) changes the state for all subsequent characters until another shift code is received.

ITA2 Code Table

BinaryDecHexLetters (LTRS)Figures (FIGS)
0000000x00NUL (Null)NUL (Null)
0000110x01E3
0001020x02LF (Line Feed)LF (Line Feed)
0001130x03A-
0010040x04SP (Space)SP (Space)
0010150x05S'
0011060x06I8
0011170x07U7
0100080x08CR (Carriage Return)CR (Carriage Return)
0100190x09DENQ (Who Are You?)
01010100x0AR4
01011110x0BJBEL (Bell)
01100120x0CN,
01101130x0DF!
01110140x0EC:
01111150x0FK(
10000160x10T5
10001170x11Z+
10010180x12L)
10011190x13W2
10100200x14H£
10101210x15Y6
10110220x16P0
10111230x17Q1
11000240x18O9
11001250x19B?
11010260x1AG&
11011270x1BFIGS (Shift to Figures)FIGS (Shift to Figures)
11100280x1CM.
11101290x1DX/
11110300x1EV=
11111310x1FLTRS (Shift to Letters)LTRS (Shift to Letters)

Control Characters

CodeNameDescription
0 (00000)NULNull - No operation, used for timing/padding
2 (00010)LFLine Feed - Move paper up one line
4 (00100)SPSpace - Blank character, advances position
8 (01000)CRCarriage Return - Return print head to start of line
27 (11011)FIGSFigures Shift - Switch to figures mode
31 (11111)LTRSLetters Shift - Switch to letters mode

Figures Mode Special Codes

CodeCharacterNotes
9 (01001)ENQ"Who Are You?" - Requests station identification
11 (01011)BELBell - Rings the teleprinter bell

US TTY Variant

The United States used a variant called US TTY (Teletypewriter) with some different figure assignments:

CodeITA2US TTY
5 (00101)' (apostrophe)BEL (bell)
11 (01011)BEL (bell)' (apostrophe)
20 (10100)£ (pound)$ (dollar)

Encoding Example

To send "HELLO 123":

CharacterShift StateCode SentBinary
LTRS-3111111
HLetters2010100
ELetters100001
LLetters1810010
LLetters1810010
OLetters2411000
SPLetters400100
FIGS-2711011
1Figures2310111
2Figures1910011
3Figures100001

Quick Reference: Letters Mode

ABCDEFGHIJKLM
3251491132620611151828
NOPQRSTUVWXYZ
122422231051673019292117

Quick Reference: Figures Mode (Digits)

0123456789
22231911016217624
History

1870s — Émile Baudot. French telegraph engineer Émile Baudot patented his 5-bit code in 1874 to replace the older Morse code on multi-channel telegraph circuits. Morse was variable-length and asynchronous, which made it impossible to multiplex efficiently; Baudot's fixed-width code let multiple operators share a single wire by time-division multiplexing, dramatically increasing the throughput of telegraph offices. Baudot also invented a five-key piano-like keyboard specifically tuned to enter his code — the operator played each character as a five-finger chord. The unit of signaling speed, the "baud," is named for him.

1901-1932 — Donald Murray and ITA2. New Zealand-born engineer Donald Murray redesigned Baudot's code in 1901 to better suit keyboard-driven typewriters: he reassigned codes so that common letters required less mechanical wear on the print mechanism, and added punctuation. The CCITT (Consultative Committee on International Telephony and Telegraphy, predecessor to the ITU-T) standardized Murray's scheme as International Telegraph Alphabet No. 2 (ITA2) in 1932. ITA1 was the original Baudot; ITA2 (Murray's revision) is what almost everyone calls "Baudot" today, including this table.

The shift-state trick. Five bits gives only 32 codes. To represent 26 letters, 10 digits, and punctuation, Baudot/ITA2 uses two shift states — LTRS (code 31) and FIGS (code 27). Each one switches the meaning of all subsequent codes until the other shift is sent. This is why a hardware glitch on a teleprinter line could turn an entire message into nonsense: if the receiver missed an LTRS or FIGS shift, every following character was mis-decoded. Operators developed a habit of repeating shifts every few words for resync.

Mechanical speeds. Baudot ran at 45.45, 50, 56.9, 75, or 100 baud on mechanical teleprinters — speeds chosen to match the resonant frequency of the Teletype's spring-driven type-bar mechanism. Each character was one start bit, five data bits, and 1.5 stop bits (the half-bit stop was a clever way to keep the receiver in sync without a full-bit gap). At 50 baud, that gave roughly 6.7 characters per second — about 400 characters per minute, fast enough for live typed conversation.

Telex and TWX. From the 1930s through the 1980s, Baudot/ITA2 was the backbone of the global Telex network (international) and TWX (Teletypewriter Exchange Service, North America). At its peak in the 1980s, Telex linked over 2 million machines worldwide and was the primary medium for legally-binding international business communication — faster than mail, more durable than phone, and accepted in court as documentary evidence. Telex didn't begin its decline until fax (1980s) and email (1990s) took over.

TDD/TTY for the deaf. After commercial Telex died, Baudot lived on in telecommunication devices for the deaf. The TDD/TTY (Telecommunication Device for the Deaf, also called Teletypewriter) protocol used ITA2 with US TTY variant figure assignments at 45.45 or 50 baud over the regular phone network, with distinctive "warble" tones (1400/1800 Hz). TDD/TTY usage held on into the 2000s before being replaced by video relay services and SMS. Some emergency 911 systems still accept TDD calls today as a regulatory accessibility requirement.

Why no lowercase? Mechanical teleprinters had a single set of physical type-bars per character position — adding lowercase would have doubled the mechanism cost and paper-tape width. By the time printing technology made mixed case practical (the 1960s), 7-bit ASCII was already taking over, so Baudot remained an uppercase-only standard throughout its commercial life.

Appendix F: ZX Spectrum Character Set

The Sinclair ZX Spectrum (1982) used a custom character set based on ASCII but with unique additions. It shared standard ASCII printable characters (0x20-0x7F) with two notable exceptions, and added block graphics characters and BASIC keyword tokens in the upper range.

Control Characters (0x00-0x1F)

The ZX Spectrum uses several custom control codes. Most codes below 0x06 are not used.

HexDecNameDescription
0x066COMMAPRINT comma control (move to next print zone)
0x088LEFTCursor Left (Backspace)
0x099RIGHTCursor Right
0x0A10DOWNCursor Down
0x0B11UPCursor Up
0x0C12DELETEDelete
0x0D13ENTEREnter / Newline
0x1016INKSet ink (foreground) color (next byte = 0-7)
0x1117PAPERSet paper (background) color (next byte = 0-7)
0x1218FLASHSet flash attribute (next byte = 0 or 1)
0x1319BRIGHTSet bright attribute (next byte = 0 or 1)
0x1420INVERSESet inverse attribute (next byte = 0 or 1)
0x1521OVERSet overprint mode (next byte = 0 or 1)
0x1622ATPosition cursor (next 2 bytes = row, column)
0x1723TABTab to column (next 2 bytes = column number)

Character Set Differences from ASCII

The ZX Spectrum printable range (0x20-0x7F) matches standard ASCII except for two positions:

HexDecASCIIZX Spectrum
0x6096` (backtick)£ (pound sterling)
0x7F127DEL© (copyright symbol)

ZX Spectrum Colors

Used with the INK (0x10) and PAPER (0x11) control codes:

ValueColorBright Color
0BlackBlack
1BlueBright Blue
2RedBright Red
3MagentaBright Magenta
4GreenBright Green
5CyanBright Cyan
6YellowBright Yellow
7WhiteBright White

Block Graphics Characters (0x80-0x8F)

The ZX Spectrum's distinctive block graphics divide each character cell into four quadrants (2×2 grid). Each of the 16 combinations represents a different pattern of filled and empty quadrants. These were widely used for games and UI elements.

HexDecPatternDescription
0x80128 All empty (space)
0x81129Bottom-right quadrant
0x82130Bottom-left quadrant
0x83131Bottom half
0x84132Top-right quadrant
0x85133Right half
0x86134Top-right + bottom-left (diagonal)
0x87135Top-right + bottom half
0x88136Top-left quadrant
0x89137Top-left + bottom-right (diagonal)
0x8A138Left half
0x8B139Top-left + bottom half
0x8C140Top half
0x8D141Top half + bottom-right
0x8E142Top half + bottom-left
0x8F143Full block (all filled)

User Defined Graphics (0x90-0xA4)

Characters 0x90-0xA4 (144-164) are User Defined Graphics (UDG) slots A through U. These are customizable 8×8 pixel characters that programs can redefine. By default, they display as letters A-U, but games and applications typically redefine them for custom sprites and icons.

HexDecUDG LetterHexDecUDG LetterHexDecUDG Letter
0x90144A0x97151H0x9E158O
0x91145B0x98152I0x9F159P
0x92146C0x99153J0xA0160Q
0x93147D0x9A154K0xA1161R
0x94148E0x9B155L0xA2162S
0x95149F0x9C156M0xA3163T
0x96150G0x9D157N0xA4164U

BASIC Keyword Tokens (0xA5-0xFF)

The ZX Spectrum stored BASIC keywords as single-byte tokens to save memory. When listed, each token expands to the full keyword. This is a selection of the most commonly used tokens:

HexDecKeywordHexDecKeyword
0xA5165RND0xD7215BEEP
0xA6166INKEY$0xD9217INK
0xA7167PI0xDA218PAPER
0xAB171ATTR0xE0224LPRINT
0xAC172AT0xE1225LLIST
0xAF175CODE0xE3227READ
0xB0176VAL0xE7231BORDER
0xB1177LEN0xEC236GO TO
0xBE190PEEK0xED237GO SUB
0xC0192USR0xEE238INPUT
0xC2194CHR$0xEF239LOAD
0xCA202LINE0xF4244POKE
0xCB203THEN0xF5245PRINT
0xCC204TO0xF9249RANDOMIZE
0xCD205STEP0xFA250IF
0xD1209MOVE0xFB251CLS
History

1982 — Sinclair Research, Cambridge. Sir Clive Sinclair's Sinclair Research launched the ZX Spectrum on April 23, 1982 at the Earls Court Computer Fair in London. The 16K model cost £125 and the 48K model £175 — roughly half the price of an Acorn BBC Micro and a third of an Apple II. This aggressive pricing was Sinclair's signature move; he had already shipped the calculator-style ZX80 (1980) and ZX81 (1981) on the same philosophy. The Spectrum's distinctive grey-with-rainbow case was designed by industrial designer Rick Dickinson, who also did the ZX81.

The dead-flesh keyboard. The original Spectrum used a flat rubber membrane keyboard — nicknamed "dead flesh" by the British computing press — in which each key had up to five different functions printed on it: the letter, a BASIC keyword, an extended-mode command, and two symbols. Pressing K alone entered the LIST keyword; SHIFT+K entered the symbol "+"; SYMBOL SHIFT+K entered "+"; EXTENDED MODE then K entered the keyword TAN. This crowding was a memory-saving trick — the BASIC interpreter could store entire keywords as single-byte tokens (0xFB = CLS, 0xF5 = PRINT) without a parser, because the user literally couldn't type a keyword character-by-character.

Color attribute clash. The Spectrum's display was 256x192 monochrome pixels overlaid with a 32x24 grid of color attributes — each character cell could pick its own ink and paper from the 8-color palette, but only one ink/paper combo per cell. This produced the infamous "attribute clash" where two sprites overlapping in the same character cell forced their colors to merge. Game programmers turned the limitation into an aesthetic: classics like Knight Lore, Manic Miner, and Jet Set Willy have an unmistakable look that comes directly from working within (or against) the attribute grid.

The block graphics range. Codes 0x80-0x8F are 16 block-graphics glyphs covering every combination of a 2x2 quadrant grid. They doubled the effective screen resolution to 512x384 "pixels" for character-mode rendering — useful for charts, BASIC graphics, and simple games that didn't need pixel-exact sprites. The 21 User Defined Graphics slots (0x90-0xA4) let programs install their own 8x8 glyphs into BASIC's character set, which is how nearly every Spectrum game drew its sprites.

Sales and the British games industry. The Spectrum sold roughly 5 million units worldwide, the bulk of them in the UK, where it dominated the home-computer market through the mid-1980s. It birthed an entire British games industry: Ultimate Play the Game (later Rare), Ocean Software, Imagine, Codemasters, and dozens of bedroom developers shipped games on cassette tapes that loaded for five minutes from screeching audio over the machine's EAR jack. Many of those developers are still active in the modern industry. Sinclair sold the Spectrum business to Amstrad in 1986, which kept producing it (the Spectrum +2, +3) until 1992.

Modern revival. The Spectrum has one of the most active retro communities of any vintage platform. Modern hardware reproductions (the ZX Spectrum Next, an FPGA-based reimplementation funded on Kickstarter in 2017, and the ZX-Uno) sell in the tens of thousands. The annual Crash Live and Spectrum demoscene events still draw crowds, and new commercial games for the original Spectrum still ship on cassette every year. The machine's character set, including its block graphics and keyword tokens, is still natively supported by emulators like Fuse, ZEsarUX, and Spectaculator.

Appendix G: TRS-80 Character Set

The Tandy/Radio Shack TRS-80 (1977) used a custom character set. The lower range (0x00-0x7F) follows ASCII for standard characters. The upper range (0x80-0xFF) contains the TRS-80's distinctive semigraphics characters — block graphics formed by dividing each character cell into a 2×3 grid of six independently controllable pixels.

Control Characters (0x00-0x1F)

The TRS-80 uses standard ASCII control characters. Most are not printable. Key codes relevant to terminal operation:

HexDecNameDescription
0x088BSBackspace (cursor left)
0x099HTHorizontal Tab
0x0A10LFLine Feed (cursor down)
0x0D13CRCarriage Return (Enter)
0x0E14SOCursor On (Model III/4)
0x0F15SICursor Off (Model III/4)
0x1723ETBCursor right (Model III/4)
0x1824CANBackspace and erase
0x1A26SUBCursor up (Model III/4)
0x1B27ESCEscape (Model III/4 only)
0x1C28FSHome cursor
0x1D29GSCursor right
0x1E30RSCursor down
0x1F31USClear screen and home (Model I: home only)

Printable Characters (0x20-0x5F)

Standard ASCII digits, punctuation, and uppercase letters. The TRS-80 Model I did not have lowercase letters — positions 0x60-0x7F were unused or mapped to additional graphics. The Model III and Model 4 added lowercase in this range.

HexDecCharHexDecCharHexDecChar
0x2032(space)0x304800x4064@
0x2133!0x314910x4165A
0x2234"0x325020x4266B
0x2335#0x335130x4367C
0x2436$0x345240x4468D
0x2537%0x355350x4569E
0x2638&0x365460x4670F
0x2739'0x375570x4771G
0x2840(0x385680x4872H
0x2941)0x395790x4973I
0x2A42*0x3A58:0x4A74J
0x2B43+0x3B59;0x4B75K
0x2C44,0x3C60<0x4C76L
0x2D45-0x3D61=0x4D77M
0x2E46.0x3E62>0x4E78N
0x2F47/0x3F63?0x4F79O
0x5080P
0x5181Q
0x5282R
0x5383S
0x5484T
0x5585U
0x5686V
0x5787W
0x5888X
0x5989Y
0x5A90Z
0x5B91[
0x5C92\
0x5D93]
0x5E94^
0x5F95_

Lowercase Characters (0x60-0x7F) — Model III/4 Only

The TRS-80 Model I lacked lowercase letters entirely. The Model III (1980) and Model 4 (1983) added lowercase in the 0x60-0x7F range, matching standard ASCII for 0x60-0x7E. Position 0x7F is non-printing and is treated as DEL in software but displays as a small block glyph (often used as a cursor) on the Model III/4 character generator ROMs.

HexDecCharHexDecCharHexDecChar
0x6096`0x6B107k0x76118v
0x6197a0x6C108l0x77119w
0x6298b0x6D109m0x78120x
0x6399c0x6E110n0x79121y
0x64100d0x6F111o0x7A122z
0x65101e0x70112p0x7B123{
0x66102f0x71113q0x7C124|
0x67103g0x72114r0x7D125}
0x68104h0x73115s0x7E126~
0x69105i0x74116t0x7F127DEL / cursor block
0x6A106j0x75117u

Semigraphics Characters (0x80-0xBF)

The TRS-80's most distinctive feature: 64 block graphics characters formed by dividing each character cell into a 2×3 grid of six pixels. Each pixel can be on (white) or off (black), giving 26 = 64 possible patterns. The pixel positions are numbered as bits:

Pixel LayoutBit Weight
Top-leftTop-right1, 2
Middle-leftMiddle-right4, 8
Bottom-leftBottom-right16, 32

The character code is calculated as: 0x80 + (sum of active pixel bit weights)

For example: top-left (1) + middle-right (8) + bottom-left (16) = 0x80 + 25 = 0x99

HexDecActive PixelsDescription
0x80128(none)Empty block (all pixels off)
0x811291Top-left only
0x821302Top-right only
0x831311+2Top row
0x841324Middle-left only
0x851331+4Left column top two
0x881368Middle-right only
0x8C1404+8Middle row
0x9014416Bottom-left only
0x931471+2+16Top row + bottom-left
0xA016032Bottom-right only
0xA11611+32Top-left + bottom-right (diagonal)
0xB017616+32Bottom row
0xB31791+2+16+32Top + bottom rows
0xBC1884+8+16+32Middle + bottom rows
0xBF1911+2+4+8+16+32Full block (all pixels on)

Common Semigraphics Patterns

A quick reference for frequently used block patterns in TRS-80 programs:

PatternHexBitsUse
Full block0xBF63Solid fill, walls
Left half0x951+4+16Vertical dividers
Right half0xAA2+8+32Vertical dividers
Top half0x8F1+2+4+8Horizontal dividers
Bottom half0xB016+32Horizontal dividers, underlines
Checkerboard A0x991+8+16Shading, dithering
Checkerboard B0xA62+4+32Shading, dithering
Top row0x831+2Thin top border
Middle row0x8C4+8Thin middle line
Bottom row0xB016+32Thin bottom border

Extended Characters (0xC0-0xFF) — Model III/4

On the TRS-80 Model I, codes 0xC0-0xFF were mirrors of the semigraphics range (0x80-0xBF). On the Model III and Model 4, this range was repurposed for additional characters including international and special symbols. A selection of commonly used codes:

HexDecCharDescription
0xC0192Spade
0xC1193Heart
0xC2194Diamond
0xC3195Club
0xC4196Up Arrow
0xC5197Down Arrow
0xC6198Left Arrow
0xC7199Right Arrow
0xCB203£Pound Sterling
0xCC204¥Yen
0xCF207©Copyright
0xD0208®Registered
0xD3211¼One Quarter
0xD4212½One Half
0xDB219Horizontal Line
0xDC220Vertical Line
0xDD221Top-Left Corner
0xDE222Top-Right Corner
0xDF223Bottom-Left Corner
0xE0224Bottom-Right Corner
0xE1225Cross (intersection)
0xE2226Left T-junction
0xE3227Right T-junction
0xE4228Top T-junction
0xE5229Bottom T-junction
History

August 1977 — Tandy/Radio Shack. The TRS-80 Model I shipped on August 3, 1977 — about two months after the Apple II began shipping and roughly two months before the Commodore PET 2001 reached customers (the PET had been announced in January 1977 but didn't ship in volume until October). Tandy Corporation's electronics chain Radio Shack already had over 3,000 retail stores in the U.S., which gave the Model I instant distribution that Apple and Commodore couldn't match. It was designed by Steve Leininger in Fort Worth, Texas, on the staff of Don French (the Radio Shack buyer who championed the project). The "TRS" stood for Tandy Radio Shack; "80" referenced the Z80 CPU.

The "1977 Trinity." Byte magazine retroactively named the Apple II, TRS-80 Model I, and Commodore PET the "1977 Trinity" — the three machines that turned the personal computer from a hobbyist kit (Altair 8800, IMSAI 8080, KIM-1) into a consumer product you could plug in and use. Of the three, the TRS-80 was by far the cheapest at $599 (Model I, 4K) and had the most retail presence. From 1977 to 1981 it outsold both rivals; estimates put the Model I and Model III combined at roughly 250,000 units.

The 2x3 semigraphics trick. The TRS-80's video hardware had no dedicated graphics chip and no bitmap mode — just a character-cell display. Leininger's solution was elegant: codes 0x80-0xBF in the character set are 64 block-graphics glyphs covering every possible combination of six pixels arranged in a 2x3 grid inside a single character cell. With a 64-column by 16-row text display, that gave an effective 128x48 "graphics" resolution for free, using only the text-mode hardware. Every TRS-80 game, every chart, every menu border was drawn this way. The technique was so effective that the later CoCo (Color Computer) inherited a similar scheme.

The "Trash-80" reputation. Competitors and the computing press derisively nicknamed it the "Trash-80" — partly because of the cheap-feeling silver-and-black plastic case, partly because of the famous silver-mylar keyboard reliability problems on the Model I, and partly because Tandy's tape-loading was notoriously unreliable (the cassette interface clipped at strange audio levels). Despite that, it was solid-enough that an enormous third-party market sprang up to fix or upgrade it: Percom disk drives, Lobo controllers, lowercase-character modification kits, and a thriving software market that survived into the late 1980s.

Model I → III → 4. The Model I was discontinued in 1981 because it failed FCC radio-frequency emission rules — its bare-PCB-on-desk design leaked Z80 clock harmonics across the AM radio band. The Model III (1980) was a redesign in a single integrated case that passed FCC, added lowercase (the original Model I had no lowercase letters; positions 0x60-0x7F were unused or duplicated graphics), and bumped RAM. The Model 4 (1983) added an 80-column mode, more RAM, and CP/M compatibility — a tacit admission that the IBM PC had taken over the business market. The 4P (1983) was a "luggable" portable variant.

Color Computer (CoCo) and after. Tandy's TRS-80 Color Computer (1980) shared the TRS-80 brand but was an entirely different machine architecturally — a Motorola 6809 with a Motorola graphics chip, no relation to the Model I/III/4 line. The Z80-based TRS-80 Model 4 was the last machine in the original lineage; Tandy quietly dropped the Z80 line in 1991 and focused on IBM-compatible PCs (the Tandy 1000 family). The Model 4 character set described in this appendix is the most complete; the Model I was a strict subset (no lowercase, semigraphics-only upper range).

Today. The TRS-80 retro community is smaller than the C64 or Spectrum scenes but very active. Emulators (TRS80gp, MAME, sdltrs) cover all four models faithfully, and projects like the Model 1 reproduction PCB and FreHD (a CompactFlash-based hard-disk replacement) keep real hardware running. The 1977 Computer History Museum exhibit in Mountain View permanently displays a working Model I as part of its personal-computer-revolution gallery.


← Back to User Manual