COMF

Complement f

The contents of register ‘f’ are complemented. If ‘d’ is ‘0’, the result is stored in W. If ‘d’ is ‘1’, the result is stored back in register ‘f’.

[the_ad id="3059"]

Syntax:

[ label ] COMF f,d

Operation:

NOT(f) → (destination)

Operands:

  • f is from 0 to 127 (decimal)
  • d can be either 0 or 1

Status Affected: Z

Example:

COMF REG,0

Before instruction:

REG = 0xF0
W = 0x01

After instruction:

REG = 0xF0
W = 0x0F

[the_ad id="3059"]

Example:

COMF REG,1

Before instruction:

REG = 0xF0
W = 0x01

After instruction:

REG = 0x0F
W = 0x01