TotalView User Guide : Part V: Debugging : Evaluating Expressions : Using the Evaluate Window : Writing Assembler Code

Writing Assembler Code
On the RS/6000 IBM AIX operating system, TotalView lets you use assembler code in eval points, conditional breakpoints, and in the Tools > Evaluate Dialog Box. However, if you want to use assembler constructs, you must enable compiled expressions. See About Interpreted and Compiled Expressions” for instructions.
To indicate that an expression in the breakpoint or Evaluate Dialog Box is an assembler expression, click the Assembler button in the Action Point > Properties Dialog Box.
You write assembler expressions in the target machine’s native assembler language and in a TotalView assembler language. However, the operators available to construct expressions in instruction operands, and the set of available pseudo-operators, are the same on all machines, and are described below.
The TotalView assembler accepts instructions using the same mnemonics recognized by the native assembler, and it recognizes the same names for registers that native assemblers recognize.
Some architectures provide extended mnemonics that do not correspond exactly with machine instructions and which represent important, special cases of instructions, or provide for assembling short, commonly used sequences of instructions. The TotalView assembler recognizes mnemonics if:
*
*
The relationship between the operands of the extended mnemonics and the fields in the assembled instruction code is a simple one-to-one correspondence.
Assembler language labels are indicated as name: and appear at the beginning of a line. You can place a label alone on a line. The symbols you can use include labels defined in the assembler expression and all program symbols.
The TotalView assembler operators are described in the following table:
 
(expr)
text
hi16 (expr)
hi32 (expr)
lo16 (expr)
lo32 (expr)
The TotalView assembler pseudo-operations are as follows:
 
Internal debugging option.
With no operand, toggle debugging;
0 => turn debugging off
1 => turn debugging on
$hold
$holdprocess
$holdstopall
$holdprocessstopall
$holdthreadstop
$holdthreadstopprocess
Branch to location expr using a single instruction in an architecture-independent way; using registers is not required
Internal debugging option.
Print assembler tree
$stop
$stopprocess
name=expr
Same as def name,expr
align expr [, expr ]
Align location counter to an operand 1 alignment; use operand 2 (or 0) as the fill value for skipped bytes
ascii string
Same as string
asciz string
bss name,size-expr[,expr]
Define name to represent size-expr bytes of storage in the bss section with alignment optional expr; the default alignment depends on the size:
if size-expr >= 8 then 8 else
if size-expr >= 4 then 4 else
if size-expr >= 2 then 2 else 1
byte expr [, expr ] ...
Place expr values into a series of bytes
comm name,expr
Define name to represent expr bytes of storage in the bss section; name is declared global; alignment is as in bss without an alignment argument
def name,expr
Define a symbol with expr as its value
double expr [, expr ] ...
Place expr values into a series of doubles
equiv name,name
fill expr, expr, expr
float expr [, expr ] ...
Place expr values into a series of floating point numbers
global name
Declare name as global
half expr [, expr ] ...
Place expr values into a series of 16-bit words
lcomm name,expr[,expr]
lsym name,expr
Same as def name,expr but allows redefinition of a previously defined name
org expr [, expr ]
quad expr [, expr ] ...
Place expr values into a series of 64-bit words
string string
Place string into storage
word expr [, expr ] ...
Place expr values into a series of 32-bit words
zero expr
Fill expr bytes with zeros

Rogue Wave Software, Inc.
Voice: (303) 473-9118
rwonlinedocs@roguewave.com