Skip to content

MSX escape codes ​

Every escape that can be typed in MSX source, and the byte it stores. Escapes are recognised in string literals, REM comments and DATA bodies. The MSX International character set has a real glyph for almost every byte — accented letters, block graphics, Greek and mathematics all print as themselves — so the only bytes needing an escape are the control codes below 0x20, the delete at 0x7F and the cursor cell at 0xFF, and every one of them is written in the raw {0xNN} form. A brace pair spelling no such escape is ordinary text, the machine having real braces at 0x7B and 0x7D. The rows below therefore say what each byte does when it is printed. The four graphic characters are the exception to all of that: they are one character in the editor and two bytes in the program, the graphic header 0x01 followed by the code plus 0x40. Filters can be prefilled with ?q= and ?cat= query parameters.

See also the MSX BASIC reference and file formats.

Description
{0x01}0x01The graphic header. The next byte is printed as the glyph of that byte minus 0x40, which is how the shapes of codes 0x00-0x1F are put on screen at all: as commands they would clear the screen or move the cursor instead.
⇦
also: {0x01}{0x52}
0x01 0x52The left arrow: the glyph of code 0x12.
⇧
also: {0x01}{0x53}
0x01 0x53The up arrow: the glyph of code 0x13.
⇨
also: {0x01}{0x51}
0x01 0x51The right arrow: the glyph of code 0x11, reached through the graphic header. One character in the editor, two bytes in the program.
⇩
also: {0x01}{0x54}
0x01 0x54The down arrow: the glyph of code 0x14.
{0x07}0x07Sounds the beeper, exactly as BEEP does - the same envelope on the same sound chip. Nothing changes on screen.
{0x08}0x08Moves the cursor one column left without erasing anything. Code 0x7F is the destructive version.
{0x09}0x09Tab: advances to the next eight-column stop, writing spaces over what it passes.
{0x0A}0x0ALine feed: moves down one row and keeps the column, scrolling the screen at the bottom.
{0x0B}0x0BHome: moves the cursor to the top left. The screen is left as it is - code 0x0C is the one that clears it.
{0x0C}0x0CClears the screen and homes the cursor, exactly as CLS does.
{0x0D}0x0DCarriage return: moves to column 0 of the row the cursor is already on, without moving down.
{0x1B}0x1BEscape: what follows is read as a screen command rather than printed. The machine takes a small VT-52-style set - E clears the screen, J erases to the end of it, K erases to the end of the line, L inserts a line, M deletes one, and A, B, C and D move the cursor.
{0x1C}0x1CMoves the cursor one column right.
{0x1D}0x1DMoves the cursor one column left.
{0x1E}0x1EMoves the cursor one row up.
{0x1F}0x1FMoves the cursor one row down.
{0x7F}0x7FErases the character to the left of the cursor and moves there. Nothing after it is pulled along.
{0xNN}anyAny byte with no character of its own, written as two hexadecimal digits: the control codes not listed above, which this machine prints as nothing at all, and code 0xFF, the cursor cell, which has no shape to stand for it. A brace pair that spells no such escape is ordinary text, the machine having real braces at 0x7B and 0x7D.

Showing 19 of 19 escape codes

Released under GNU GPL v3.0. Some ROM images are third-party copyrighted works, separate to this project, strictly for personal/educational purposes.