Characters in Numeric Constants

An underscore (_) can be inserted in a numeric constant to improve readability, as follows 1_000_000. An underscore can be inserted anywhere except before the first character. The assembler ignores underscores.

Characters can represent numeric constants. For instance, a single ASCII character can represent a numeric constant by enclosing it in single quotes (’’). The numeric constant is the ASCII value of the specified characterise use other special characters to represent numeric constants, use the character escapes defined in the ANSI C language, and enclose them in single quotes. Table below lists the common character escapes. To use the single quote ( ) to represent a numeric constant, insert a backslash (\) before it, and enclose both in single quotes (’’), as such,’\’’.

Common Character Escapes

Escape Character

Definition

ASCII Value

\’

Single quote

39

\"

Double quote

34

\b

Backspace

8

\t

Tab

9

\n

New line

10

\f

Form feed

12

\r

Carriage return

13

\\

Backslash

92

\num

Character with octal value num (maximum three digits)

\Xhh

 

Character with the hexadecimal value hh (maximum two digits)