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

Assembler Language Reference

extsb (Extend Sign Byte) Instruction

Purpose

Extends the sign of the low-order byte.

Note: The extsb instruction is supported only in the PowerPC architecture.

Syntax

Bits Value
0-5 31
6-10 RS
11-15 RA
16-20 ///
21-30 954
31 Rc
PowerPC 
extsb RA, RS
extsb. RA, RS

Description

The extsb instruction places bits 24-31 of general-purpose register (GPR) RS into bits 24-31 of GPR RA and copies bit 24 of register RS in bits 0-23 of register RA.

The extsb instruction has two syntax forms. Each syntax form has a different effect on Condition Register Field 0 and the Fixed-Point Exception Register.

If the syntax form sets the Record (Rc) bit to 1, the instruction affects the Less Than (LT) zero, Greater Than (GT) zero, Equal To (EQ) zero, and Summary Overflow (SO) bits in Condition Register Field 0.

Parameters

RA Specifies target general-purpose register where result of operation is stored.
RS Specifies source general-purpose register of containing the byte to be extended.

Examples

  1. The following code extends the sign of the least significant byte contained in GPR 4 and places the result in GPR 6:

    # Assume GPR 6 holds 0x5A5A 5A5A.
    extsb 4,6
    # GPR 6 now holds 0x0000 005A.
  2. The following code extends the sign of the least significant byte contained in GPR 4 and sets Condition Register Field 0 to reflect the result of the operation:

    # Assume GPR 4 holds 0xA5A5 A5A5.
    extsb. 4,4
    # GPR 4 now holds 0xFFFF FFA5.

Related Information

Fixed-Point Processor .

Fixed-Point Logical Instructions .

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