View Source Chip8.Interpreter.Instruction.SUBN (chip8 v1.0.0)

Subtracts the second operand with the first operand.

This operation always returns an 8-bit number, that is stored in the first operand. When an underflow happens, the result is always wrapped to fit into the specified size.

In some variants a borrow bit is also returned, when an underflow happens the borrow bit will be 1, and 0 otherwise.

variants

Variants

OpcodeMnemonicDescription
8xy7SUBN Vx, VySet Vx = Vy - Vx and VF = NOT borrow.