4.3.2.1 Characters
A character constant can be written as the character preceded by a single
quote character, for example, 'z
, or as the character enclosed by single
quote characters, for example, 'z'
.
Special control characters an be specified by using an escape sequence. The assembler accepts the following 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 (0 - 7 ). | |
\x
hex-digits or \X
hex-digits | Hex character code. All trailing hexadecimal
digits (0 - 9 , a -
f , or A - F )are
combined. |
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 set is ASCII.