WC

Effect: Cause assembly instruction to modify the C flag.

<Label > <Condition > Instruction Operands WC


Result: C flag is updated with status from the Instruction's execution.

  • Label is an optional statement label. See Common Syntax Elements.
  • Condition is an optional execution condition. See Common Syntax Elements.
  • Instruction is the desired assembly instruction.
  • Operands is zero, one, or two operands as required by the Instruction.

Explanation

WC (Write C flag) is one of four optional effects (NR, WR, WZ, and WC) that influence the behavior of assembly instructions. WC causes an executing assembly instruction to modify the C flag in accordance with its results.

For example, the CMP (Compare Unsigned) instruction compares two values (destination and source) but does not automatically write the results to the C and Z flags. You can determine if the destination value is less than the source value by using the CMP instruction with the WC effect:

cmp    value1, value2    WC    'C = 1 if value1 < value2 

The above CMP instruction compares value1 with value2 and sets C high (1) if value1 is less than value2.

See Effects (WC, WZ, WR, NR) for more information.

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