MUXNC

Instruction: Set discrete bits of a value to the state of !C.

MUXNC Destination, < # > Mask


Result: Destination's bits, indicated by Mask, are set to the state of !C.

  • Destination (d-field) is the register whose bits described by Mask are affected by !C.
  • Mask (s-field) is a register or a 9-bit literal whose value contains high (1) bits for every bit in Destination to set to the inverse of the C flag's state.

Opcode Table:

–INSTR–  ZCRI  –CON–    –DEST–        –SRC–

Z Result

C Result

Result

Clocks

  011101    001i    1111    ddddddddd    sssssssss

Result = 0

Parity of Result

Written

4

Concise Truth Table:

In

Out

Destination

Source

Z

C

Effects

Destination

Z

C

$0000_0000; 0

$0000_0001; 1

-

0

wz wc

$0000_0001; 1

0

1

$0000_0000; 0

$0000_0001; 1

-

1

wz wc

$0000_0000; 0

1

0

$0000_0000; 0

$0000_0003; 3

-

0

wz wc

$0000_0003; 3

0

0

$0000_0000; 0

$0000_0003; 3

-

1

wz wc

$0000_0000; 0

1

0

$AA55_2200; -1,437,261,312

$1234_5678; 305,419,896

-

0

wz wc

$BA75_7678; -1,166,707,080

0

1

$AA55_2200; -1,437,261,312

$1234_5678; 305,419,896

-

1

wz wc

$A841_2000; -1,472,126,976

0

0

$AA55_2200; -1,437,261,312

$FFFF_FFFF; -1

-

0

wz wc

$FFFF_FFFF; -1

0

0

$AA55_2200; -1,437,261,312

$FFFF_FFFF; -1

-

1

wz wc

$0000_0000; 0

1

0

Explanation

MUXNC sets each bit of the value in Destination, which corresponds to Mask's high (1) bits, to the !C state. All bits of Destination that are not targeted by high (1) bits of Mask are unaffected. This instruction is handy for setting or clearing discrete bits, or groups of bits, in an existing value.

If the WZ effect is specified, the Z flag is set (1) if Destination's final value is 0. If the WC effect is specified, the C flag is set (1) if the resulting Destination contains an odd number of high (1) bits. The result is written to Destination unless the NR effect is specified.

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.