seb

Sign extend byte

Copies the low 8 bits of $t2 into $t1, with bit 7 replicated through the upper 24 bits.

Forms

  • seb ,

Operands

$t1
Any general-purpose register, $0 to $31, using its numeric or named spelling, such as $8 or $t0 ($zero is $0; $ra is $31).
$t2
A general-purpose register. It may be the same register as $t1.

Turns a byte loaded with 'lbu', or one extracted by shifting, back into a signed value.

# Apply seb to initialized pattern 0x80FF. Inspect $t2: 0xFFFFFFFF.
li $t0, 0x80FF
seb $t2, $t0