Go to the documentation of this file.
6 #ifndef __PZ80EMU_SUB__
7 #define __PZ80EMU_SUB__
16 void _cp(uint8_t *,
struct z80 *);
static void ___sub8_set_sign_flag(uint8_t a, uint8_t b, struct z80 *cpu)
sets the sign flag based on the provided operands
Definition: sub.c:71
#define CARRY
bit position of CARRY flag
Definition: z80.h:72
void _cp(uint8_t *, struct z80 *)
set flags as if operand was subtracted from A
Definition: sub.c:122
z80 memory class
Definition: memory.h:19
word pc
Definition: z80.h:53
void _sub_a_mem(struct z80 *, uint8_t *)
subtracts the contents of a memory address from the A register
Definition: sub.c:145
void _sub_a_mem(struct z80 *cpu, uint8_t *memory)
subtracts the contents of a memory address from the A register
Definition: sub.c:145
__BEGIN_DECLS void _dec8(uint8_t *, struct z80 *)
decrements an 8-bit register
Definition: sub.c:175
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
Definition: sub.c:101
#define ZERO
bit position of ZERO flag
Definition: z80.h:78
#define PARITY_OVERFLOW
bit position of OVERFLOW flag
Definition: z80.h:74
void _sub_a_reg8(struct z80 *, uint8_t *)
subtracts reg from the A register
Definition: sub.c:133
static void ___sub8_set_carry_flag(uint8_t a, uint8_t b, struct z80 *cpu)
sets the carry flag based on the provided operands
Definition: sub.c:18
#define HALF_CARRY
bit position of HALF CARRY flag
Definition: z80.h:76
z80 CPU data structure and functions
#define SIGN
bit position of SIGN flag
Definition: z80.h:79
void _cp(uint8_t *reg, struct z80 *cpu)
set flags as if operand was subtracted from A
Definition: sub.c:122
uint8_t l
low order byte
Definition: z80.h:31
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
Definition: sub.c:86
uint8_t h
high order byte
Definition: z80.h:32
struct word::@0 B
Combination of High and Low bytes in correct order for endianness.
void _sub_a_reg8(struct z80 *cpu, uint8_t *reg)
subtracts reg from the A register
Definition: sub.c:133
#define RESET(val, bit)
Resets a bit.
Definition: utils.h:31
word af
Definition: z80.h:54
uint16_t W
16-bit pair
Definition: z80.h:22
void _sbc_a_reg8(struct z80 *, uint8_t *)
subtracts an 8-bit register from the A register with carry
Definition: sub.c:159
void _sbc_a_reg8(struct z80 *cpu, uint8_t *reg)
subtracts an 8-bit register from the A register with carry
Definition: sub.c:159
static void ___sub8_set_zero_flag(uint8_t a, uint8_t b, struct z80 *cpu)
sets the zero flag based on the provided operands
Definition: sub.c:33
static void ___sub8_set_overflow_flag(uint8_t a, uint8_t b, struct z80 *cpu)
sets the overflow flag based on the provided operands
Definition: sub.c:48
#define SUBTRACT
bit position of SUBTRACT flag
Definition: z80.h:73
#define IS_SET(val, bit)
Determines if a bit is set or not.
Definition: utils.h:17
void _dec8(uint8_t *n, struct z80 *cpu)
decrements an 8-bit register
Definition: sub.c:175
#define SET(val, bit)
Sets a bit.
Definition: utils.h:24