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

Subtracts the first operand with the second 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
8xy5SUB Vx, VySet Vx = Vx - Vy and VF = NOT borrow.