Propeller Manual

Table Of Contents
3: Assembly Language Reference – REV
REV
Instruction: Reverse LSBs of value and zero-extend.
REV Value, # Bits
Result: Value has lower 32 - Bits of its LSBs reversed and upper bits cleared.
Value (d-field) is the register containing the value whose bits are reversed.
Bits (s-field) is a register or a 5-bit literal whose value subtracted from 32, (32 - Bits),
is the number of Value’s LSBs to reverse. The upper Bits MSBs of Value are
cleared.
Opcode Table:
–INSTR– ZCRI –CON– –DEST– –SRC– Z Result C Result Result Clocks
001111 001i 1111 ddddddddd sssssssss
Result = 0 D[0] Written 4
Concise Truth Table:
In Out
Destination Source Z
C
Effects
Destination Z C
$8421_DECA; -2,078,155,062
$0000_001F; 31 -
-
wz wc
$0000_0000; 0 1 0
$8421_DECA; -2,078,155,062
$0000_001C; 28 -
-
wz wc
$0000_0005; 5 0 0
$8421_DECA; -2,078,155,062
$0000_0018; 24 -
-
wz wc
$0000_0053; 83 0 0
$8421_DECA; -2,078,155,062
$0000_0010; 16 -
-
wz wc
$0000_537B; 21,371 0 0
$8421_DECA; -2,078,155,062
$0000_0000; 0 -
-
wz wc
$537B_8421; 1,400,603,681 0 0
$4321_8765; 1,126,270,821
$0000_001C; 28 -
-
wz wc
$0000_000A; 10 0 1
$4321_8765; 1,126,270,821
$0000_0018; 24 -
-
wz wc
$0000_00A6; 166 0 1
$4321_8765; 1,126,270,821
$0000_0010; 16 -
-
wz wc
$0000_A6E1; 42,721 0 1
$4321_8765; 1,126,270,821
$0000_0000; 0 -
-
wz wc
$A6E1_84C2; -1,495,169,854 0 1
Explanation
REV (Reverse) reverses the lower (32 - Bits) of Value’s LSB and clears the upper Bits of
Value’s MSBs.
If the
WZ effect is specified, the Z flag is set (1) if the resulting Value equals zero. If the WC
effect is specified, the C flag is set equal to Value’s original bit 0. The result is written to
Value unless the
NR effect is specified.
Propeller Manual v1.1 · Page 343