SPARC Assembly Language Reference Manual

2.3.5 Strings

A string is a sequence of characters quoted with either double-quote mark (") or single-quote mark (') characters. The sequence must not include a newline character. When used in an expression, the numeric value of a string is the numeric value of the ASCII representation of its first character.

The suggested style is to use single quote mark characters for the ASCII value of a single character, and double quote mark characters for quoted-string operands such as used by pseudo-ops. An example of assembly code in the suggested style is:

add %g1,'a'-'A',%g1 ! g1 + ('a' - 'A') --> g1 

The escape codes described in Table 2–1, derived from ANSI C, are recognized in strings.

Table 2–1

Escape Code 







Form feed  


Newline (line feed)  


Carriage return  


Horizontal tab  


Vertical tab  


Octal value nnn


Hexadecimal value nn...