4.4.2.1 Characters

A single character may be written as a single quote immediately followed by that character, or as a single quote immediately followed by that character and another single quote. As an example, either 'a or 'a'.

The assembler accepts escape characters to represent special control characters. As an example, '\n' represents a new-line character. All accepted escape characters are listed in the table below.

Table 4-2. Escape Characters
Escape Character Description Hex Value
\a Bell (alert) character 07
\b Backspace character 08
\f Form-feed character 0C
\n New-line character 0A
\r Carriage return character 0D
\t Horizontal tab character 09
\v Vertical tab character 0B
\\ Backslash 5C
\? Question mark character 3F
\" Double quote character 22
\digit digit digit Octal character code. The numeric code is 3 octal digits.
\x hex-digits Hex character code. All trailing hex digits are combined. Either upper or lower case x works.

The value of a character constant in a numeric expression is the machine’s byte-wide code for that character. The assembler assumes your character code is ASCII.