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

Assembler Language Reference

tw or t (Trap Word) Instruction

Purpose

Generates a program interrupt when a specified condition is true.

Syntax

Bits Value
0-5 31
6-10 TO
11-15 RA
16-20 RB
21-30 4
31 /
PowerPC 
tw TO, RA, RB
POWER family 
t TO, RA, RB

See Extended Mnemonics of Fixed-Point Trap Instructions for more information.

Description

The tw and t instructions compare the contents of general-purpose register (GPR) RA with the contents of GPR RB, AND the compared results with TO, and generate a trap-type Program Interrupt if the result is not 0.

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.

The tw and t instructions have one syntax form and do not affect the Fixed-Point Exception Register or Condition Register Field 0.

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.

Examples

The following code generates a Program Interrupt:

# Assume GPR 4 contains 0x9000 3000.
# Assume GPR 7 contains 0x789A 789B.
tw 0x10,4,7
# 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 ]