Skip to content

Atari escape codes ​

Every escape that can be typed in Atari BASIC source, and the byte it stores. Escapes are recognised in string literals and in REM and DATA bodies — the contexts where a raw byte lives in a real program. ATASCII needs fewer of them than the machines around it, because most of its low codes are drawings rather than controls: 0 to 26 are the block and line graphics printed on the fronts of the keycaps, and they come through as their own characters. What is left is the fourteen codes that move the cursor or edit the screen, plus {$xx} for the inverse-video half, which has no shapes of its own. Filters can be prefilled with ?q= and ?cat= query parameters.

See also the Atari BASIC reference and file formats.

Inverse video is a solid block ​

The top bit of a character code is inverse video, and the display chip draws an inverse character by turning the pixels of the ordinary one over. So a code and its twin 128 higher are the same shape, light on dark and dark on light — and the twin of a space is a solid block, which is what a text-mode game draws its bricks, walls and paddles out of.

That block is {$a0} in a string, CHR$(160) computed, and the ATARI key on the keyboard while typing. There is no separate graphics character set to switch into and no colour attached to it: what colour it comes out is whatever the screen's colour registers hold, which the hardware page describes.

Ending a line ​

{eol}, code 155, is this machine's end of line. It is what the RETURN key stores, what separates the lines of a LIST listing, and what terminates every record the cassette and disk handlers read or write — where most machines here would use a carriage return of 13. A listing exported from the IDE carries it, and one imported is read by it; see file formats.

Description
{esc}0x1BEscape. The screen editor swallows it and shows the code after it as a character instead of acting on it, which is how one of the codes above is put into a program line rather than obeyed. It has a shape of its own once it is sitting in screen memory.
{up}0x1CMoves the cursor up one row, wrapping to the bottom of the screen from the top row. CTRL and the up arrow on the keyboard.
{down}0x1DMoves the cursor down one row, scrolling the screen when it is already on the bottom one.
{left}0x1EMoves the cursor one column left, wrapping to the end of the row above.
{right}0x1FMoves the cursor one column right, wrapping to the start of the row below.
{clear}0x7DBlanks the screen and puts the cursor in the top left corner. This is the code every program prints first, and it is what SHIFT+CLEAR sends.
{eol}0x9BEnd of line. This machine ends a line with 0x9B rather than a carriage return, so it is what RETURN stores, what separates the lines of a LIST listing, and what terminates every record the cassette and disk handlers read or write.
{delete line}0x9CRemoves the row the cursor is on and pulls the rows below it up.
{insert line}0x9DOpens a blank row where the cursor is, pushing the rows below it down and losing the bottom one.
{clear tab}0x9EClears the tab stop at the cursor’s column.
{set tab}0x9FSets a tab stop at the cursor’s column. The stops are what CTRL+TAB moves between.
{$xx}anyAny code with no character of its own, written as two hex digits — which here is the whole inverse-video half, 0x80 to 0xFF, less the eight codes named above. Inverse video is simply the top bit set: 0x80 plus a code draws the same shape with its pixels turned over, so {$a0} is a solid block and CHR$(160) is the same thing computed. This is also the escape the editor accepts for a code that already has a glyph, so {$41} is another way of writing A.
{bell}0xFDRings the console buzzer. It is a sound the speaker makes directly rather than one of POKEY’s four voices, so it plays through whatever SOUND is doing.
{delete char}0xFERemoves the character at the cursor and pulls the rest of the logical line left. Backspace is not this code: it is 0x7E, which this charset carries as the arrow the character generator draws for it rather than as an escape.
{insert char}0xFFOpens a space at the cursor, pushing the rest of the logical line right.

Showing 15 of 15 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.