ORC.B
Bitwise OR-Combine Byte
ORC.B rd, rs1
Sets each byte of the result to 0xFF if the corresponding byte of the source is non-zero, else 0x00.
Details
ORC.B sets each byte of rd to 0xFF if the corresponding byte of rs1 is non-zero, or 0x00 if it is zero. Useful for detecting null bytes in strings.
Pseudocode Operation
For each byte i: R[rd].byte[i] = (R[rs1].byte[i] != 0) ? 0xFF : 0x00;
Example
ORC.B x10, x11
Encoding
Binary Layout
0010100
31:25
00111
24:20
rs1
19:15
101
14:12
rd
11:7
0010011
6:0
Operands
-
rd
Destination register (integer) -
rs1
Source