[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Assembler Language Reference

td (Trap Double Word) Instruction

Purpose

Generate a program interrupt when a specific condition is true.

This instruction should only be used on 64-bit PowerPC processors running a 64-bit application.

Syntax

Bits Value
0-5 31
6-10 TO
11-15 A
16-20 B
21-30 68
31 0
PowerPC64 
td TO, RA, RB

Description

The contents of general-purpose register (GPR) RA are compared with the contents of GPR RB. If any bit in the TO field is set and its corresponding condition is met by the result of the comparison, then a trap-type program interrupt is generated.

The TO bit conditions are defined as follows:

TO bit ANDed with Condition
0 Compares Less Than.
1 Compares Greater Than.
2 Compares Equal.
3 Compares Logically Less Than.
4 Compares Logically Greater Than.

Parameters

TO Specifies TO bits that are ANDed with compare results.
RA Specifies source general-purpose register for compare.
RB Specifies source general-purpose register for compare.

Implementation

This instruction is defined only for 64-bit implementations. Using it on a 32-bit implementation will cause the system illegal instruction error handler to be invoked.

Examples

The following code generates a program interrupt:

# Assume GPR 3 holds 0x0000_0000_0000_0001.
# Assume GPR 4 holds 0x0000_0000_0000_0000.
td 0x2,3,4	# A trap type Program Interrupt occurs.

Related Information

Branch Processor .

Fixed-Point Trap Instructions

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]