PZ80emu
0.1
|
Helper functions for addition operations. More...
Functions | |
static void | carry_handler (struct z80 *cpu) |
static void | ___add8_set_carry_flag (uint8_t a, uint8_t b, struct z80 *cpu) |
sets the carry flag based on the provided 8-bit operands More... | |
static void | ___add8_set_zero_flag (uint8_t a, uint8_t b, struct z80 *cpu) |
sets the zero flag based on the provided 8-bit operands More... | |
static void | ___add8_set_overflow_flag (uint8_t a, uint8_t b, struct z80 *cpu) |
sets the overflow flag based on the provided 8-bit operands More... | |
static void | ___add8_set_sign_flag (uint8_t a, uint8_t b, struct z80 *cpu) |
sets the sign flag based on the provided 8-bit operands More... | |
static void | ___add8_set_half_carry_flag (uint8_t a, uint8_t b, struct z80 *cpu) |
sets the half carry flag based on the provided 8-bit operands More... | |
static void | __add8_set_flags (uint8_t a, uint8_t b, struct z80 *cpu) |
wrapper to set all flags based on the provided addition operands More... | |
void | _add_a_reg8 (struct z80 *cpu, uint8_t *reg) |
adds the contents of a user supplied register to A More... | |
void | _adc_a_reg8 (struct z80 *cpu, uint8_t *reg) |
adds the contents of a user supplied register and the carry flag to A More... | |
void | _add_a_mem (struct z80 *cpu, uint8_t *memory) |
adds the contents of a user supplied register to A More... | |
void | _adc_a_mem (struct z80 *cpu, uint8_t *memory) |
adds contents of A to the contents of a memory address with carry More... | |
void | _add_reg16_reg16 (word *reg1, word *reg2, struct z80 *cpu) |
adds two 16-bit registers together, storing the values in reg1 More... | |
void | _inc8 (uint8_t *n, struct z80 *cpu) |
increments an 8 bit register More... | |
Helper functions for addition operations.
|
static |
sets the carry flag based on the provided 8-bit operands
a | first operand |
b | second operand |
cpu | z80 cpu object |
|
static |
sets the half carry flag based on the provided 8-bit operands
a | first operand |
b | second operand |
cpu | z80 cpu object |
The H flag is set when there is a carry from bit 3 to bit 4.
|
static |
sets the overflow flag based on the provided 8-bit operands
a | first operand |
b | second operand |
cpu | z80 cpu object |
For addition operations, the P/V flag is used for overflow. It is set when the 2's Complement result of the operation will not fit in the register.
|
static |
sets the sign flag based on the provided 8-bit operands
a | first operand |
b | second operand |
cpu | z80 cpu object |
The S flag is a copy of bit 7 of the result of the operation.
|
static |
sets the zero flag based on the provided 8-bit operands
a | first operand |
b | second operand |
cpu | z80 cpu object |
|
static |
void _adc_a_mem | ( | struct z80 * | cpu, |
uint8_t * | memory | ||
) |
adds contents of A to the contents of a memory address with carry
cpu | z80 cpu object |
memory | memory location to add to A |
void _adc_a_reg8 | ( | struct z80 * | cpu, |
uint8_t * | reg | ||
) |
adds the contents of a user supplied register and the carry flag to A
cpu | z80 cpu object |
reg | register to add to A |
void _add_a_mem | ( | struct z80 * | cpu, |
uint8_t * | memory | ||
) |
adds the contents of a user supplied register to A
cpu | z80 cpu object |
memory | pointer to system memory |
void _add_a_reg8 | ( | struct z80 * | cpu, |
uint8_t * | reg | ||
) |
adds the contents of a user supplied register to A
cpu | z80 cpu object |
reg | register to add to A |
adds two 16-bit registers together, storing the values in reg1
reg1 | the first register for the add operation |
reg2 | the second register for the add operation |
cpu | z80 cpu object |