PACKH

Pack Byte

PACKH rd, rs1, rs2

Packs the lower bytes of rs1 and rs2 into a 16-bit value.

Details

Pack Byte: Packs the lower bytes of rs1 and rs2 into a 16-bit value. Operation: R[rd] = (R[rs2] << 8) | (R[rs1] & 0xFF);.

Pseudocode Operation

R[rd] = (R[rs2] << 8) | (R[rs1] & 0xFF);

Example

PACKH t0, a0, a1

Encoding

Binary Layout
0000100
31:25
rs2
24:20
rs1
19:15
111
14:12
rd
11:7
0110011
6:0
 
Format R-Type
Opcode 0x33
Extension Zbkb

Operands

  • rd
    Destination register (integer)
  • rs1
    Source register 1 (integer)
  • rs2
    Source register 2 (integer)