PZ80emu
0.1
|
Helper functions for subtraction operations. More...
Functions | |
static void | ___sub8_set_carry_flag (uint8_t a, uint8_t b, struct z80 *cpu) |
sets the carry flag based on the provided operands More... | |
static void | ___sub8_set_zero_flag (uint8_t a, uint8_t b, struct z80 *cpu) |
sets the zero flag based on the provided operands More... | |
static void | ___sub8_set_overflow_flag (uint8_t a, uint8_t b, struct z80 *cpu) |
sets the overflow flag based on the provided operands More... | |
static void | ___sub8_set_sign_flag (uint8_t a, uint8_t b, struct z80 *cpu) |
sets the sign flag based on the provided operands More... | |
static void | ___sub8_set_half_carry_flag (uint8_t a, uint8_t b, struct z80 *cpu) |
sets the half carry flag based on the provided operands More... | |
static void | __sub8_set_flags (uint8_t a, uint8_t b, struct z80 *cpu) |
wrapper to set flags based on the operands of a subtraction operation More... | |
void | _cp (uint8_t *reg, struct z80 *cpu) |
set flags as if operand was subtracted from A More... | |
void | _sub_a_reg8 (struct z80 *cpu, uint8_t *reg) |
subtracts reg from the A register More... | |
void | _sub_a_mem (struct z80 *cpu, uint8_t *memory) |
subtracts the contents of a memory address from the A register More... | |
void | _sbc_a_reg8 (struct z80 *cpu, uint8_t *reg) |
subtracts an 8-bit register from the A register with carry More... | |
void | _dec8 (uint8_t *n, struct z80 *cpu) |
decrements an 8-bit register More... | |
Helper functions for subtraction operations.
|
static |
sets the carry flag based on the provided operands
a | |
b | |
cpu | z80 CPU object |
|
static |
sets the half carry flag based on the provided operands
a | |
b | |
cpu | z80 CPU object |
|
static |
sets the overflow flag based on the provided operands
a | |
b | |
cpu | z80 CPU object |
|
static |
sets the sign flag based on the provided operands
a | |
b | |
cpu | z80 CPU object |
|
static |
sets the zero flag based on the provided operands
a | |
b | |
cpu | z80 CPU object |
|
static |
wrapper to set flags based on the operands of a subtraction operation
a | |
b | |
cpu | z80 CPU object |
void _cp | ( | uint8_t * | reg, |
struct z80 * | cpu | ||
) |
set flags as if operand was subtracted from A
reg | register to subtract from A |
cpu | z80 CPU object |
The CP instruction sets the flags as if the operand to CP were subtracted from the A register, however the subtraction does not actually occur, and the original value of A is left untouched.
void _dec8 | ( | uint8_t * | n, |
struct z80 * | cpu | ||
) |
void _sbc_a_reg8 | ( | struct z80 * | cpu, |
uint8_t * | reg | ||
) |
subtracts an 8-bit register from the A register with carry
cpu | z80 CPU object |
reg | register to subtract from A |
void _sub_a_mem | ( | struct z80 * | cpu, |
uint8_t * | memory | ||
) |
subtracts the contents of a memory address from the A register
cpu | z80 CPU object |
memory | pointer to memory to subtract from the A register |