Skip to content

SAM Coupé escape codes ​

Every escape that can be typed in SAM Coupé source, and the byte it stores. Escapes are recognised in string literals, REM comments and DATA bodies. The SAM's font covers 0x20–0x7F with a real glyph for every code — including both letter cases, £ at 0x60, © at 0x7F and the up arrow at 0x5E that is also the power operator — and the sixteen 2×2 block graphics at 0x80–0x8F and the twenty-five user-defined characters at 0x90–0xA8 are written as their Unicode equivalents, so most of the character set needs no escape at all. What is left is the eight embedded print-control directives, the \a–\y spellings of the user-defined graphics (an alternative to the squared capitals 🄰–🅈, so they are accepted on the way in and never produced on the way out), the backslash that has to escape itself, and the raw {0xNN} form for everything else. A {…} spelling no directive is ordinary text, the SAM having real braces at 0x7B and 0x7D. Filters can be prefilled with ?q= and ?cat= query parameters.

See also the SAM BASIC reference and file formats.

Description
{INK n}parse-only0x10 nAccepted as a spelling of {PEN n}, the way the keyword INK is accepted for PEN. It stores the same byte and lists back as {PEN n}.
{PEN n}0x10 nEmbedded PEN control: sets the foreground colour from this point in the string, as one of the sixteen palette slots.
{PAPER n}0x11 nEmbedded PAPER control: sets the background colour.
{FLASH n}0x12 nEmbedded FLASH control: n = 1 alternates pen and paper, 0 is steady. An attribute bit, so it shows in mode 1 only.
{BRIGHT n}0x13 nEmbedded BRIGHT control: n = 1 selects the bright half of the colour pair, 0 the normal one. Mode 1 only, for the same reason as FLASH.
{INVERSE n}0x14 nEmbedded INVERSE control: n = 1 swaps pen and paper as the characters are drawn, 0 is normal. Works in every mode.
{OVER n}0x15 nEmbedded OVER control: n = 1 combines with what is already on screen, 0 replaces it.
{AT r,c}0x16 r cEmbedded AT control: moves the print position to row r, column c. Rows 19 and 20 are the lower window and are off screen to it.
{TAB n}0x17 n 0x00Embedded TAB control: moves the print position to column n. The ROM reads two operand bytes and discards the second, so the directive writes a zero for it; a stored non-zero second byte has no spelling and comes back as raw bytes.
\\0x5CA literal backslash, which the SAM really has at 0x5C. It needs escaping because a lone backslash opens a UDG escape.
{0xNN}anyAny raw byte as two hex digits — the control codes with no directive, the blank block graphic at 0x80, the keyword-token bytes from 0xA9 up inside a string, and a control directive whose operands are truncated. A {…} spelling no directive is ordinary text, the SAM having real braces at 0x7B and 0x7D.
\aparse-only
also: 🄰
0x90User-defined graphic A (CHR$ 144), written 🄰. Its shape is the eight bytes at UDG "a".
\bparse-only
also: 🄱
0x91User-defined graphic B (CHR$ 145), written 🄱. Its shape is the eight bytes at UDG "b".
\cparse-only
also: 🄲
0x92User-defined graphic C (CHR$ 146), written 🄲. Its shape is the eight bytes at UDG "c".
\dparse-only
also: 🄳
0x93User-defined graphic D (CHR$ 147), written 🄳. Its shape is the eight bytes at UDG "d".
\eparse-only
also: 🄴
0x94User-defined graphic E (CHR$ 148), written 🄴. Its shape is the eight bytes at UDG "e".
\fparse-only
also: 🄵
0x95User-defined graphic F (CHR$ 149), written 🄵. Its shape is the eight bytes at UDG "f".
\gparse-only
also: 🄶
0x96User-defined graphic G (CHR$ 150), written 🄶. Its shape is the eight bytes at UDG "g".
\hparse-only
also: 🄷
0x97User-defined graphic H (CHR$ 151), written 🄷. Its shape is the eight bytes at UDG "h".
\iparse-only
also: 🄸
0x98User-defined graphic I (CHR$ 152), written 🄸. Its shape is the eight bytes at UDG "i".
\jparse-only
also: 🄹
0x99User-defined graphic J (CHR$ 153), written 🄹. Its shape is the eight bytes at UDG "j".
\kparse-only
also: 🄺
0x9AUser-defined graphic K (CHR$ 154), written 🄺. Its shape is the eight bytes at UDG "k".
\lparse-only
also: 🄻
0x9BUser-defined graphic L (CHR$ 155), written 🄻. Its shape is the eight bytes at UDG "l".
\mparse-only
also: 🄼
0x9CUser-defined graphic M (CHR$ 156), written 🄼. Its shape is the eight bytes at UDG "m".
\nparse-only
also: 🄽
0x9DUser-defined graphic N (CHR$ 157), written 🄽. Its shape is the eight bytes at UDG "n".
\oparse-only
also: 🄾
0x9EUser-defined graphic O (CHR$ 158), written 🄾. Its shape is the eight bytes at UDG "o".
\pparse-only
also: 🄿
0x9FUser-defined graphic P (CHR$ 159), written 🄿. Its shape is the eight bytes at UDG "p".
\qparse-only
also: 🅀
0xA0User-defined graphic Q (CHR$ 160), written 🅀. Its shape is the eight bytes at UDG "q".
\rparse-only
also: 🅁
0xA1User-defined graphic R (CHR$ 161), written 🅁. Its shape is the eight bytes at UDG "r".
\sparse-only
also: 🅂
0xA2User-defined graphic S (CHR$ 162), written 🅂. Its shape is the eight bytes at UDG "s".
\tparse-only
also: 🅃
0xA3User-defined graphic T (CHR$ 163), written 🅃. Its shape is the eight bytes at UDG "t".
\uparse-only
also: 🅄
0xA4User-defined graphic U (CHR$ 164), written 🅄. Its shape is the eight bytes at UDG "u".
\vparse-only
also: 🅅
0xA5User-defined graphic V (CHR$ 165), written 🅅. Its shape is the eight bytes at UDG "v".
\wparse-only
also: 🅆
0xA6User-defined graphic W (CHR$ 166), written 🅆. Its shape is the eight bytes at UDG "w".
\xparse-only
also: 🅇
0xA7User-defined graphic X (CHR$ 167), written 🅇. Its shape is the eight bytes at UDG "x".
\yparse-only
also: 🅈
0xA8User-defined graphic Y (CHR$ 168), written 🅈. Its shape is the eight bytes at UDG "y".

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