PZ80emu  0.1
add.h
Go to the documentation of this file.
1 
5 #ifndef __PZ80EMU_ADD__
6 #define __PZ80EMU_ADD__
7 
8 #include <stdint.h>
9 
10 #include "z80.h"
11 
12 __BEGIN_DECLS
13 void _inc8(uint8_t *, struct z80 *);
14 void _add_reg16_reg16(word *, word *, struct z80 *);
15 void _add_a_mem(struct z80 *, uint8_t *);
16 void _add_a_reg8(struct z80 *, uint8_t *);
17 void _adc_a_reg8(struct z80 *, uint8_t *);
18 void _adc_a_mem(struct z80 *, uint8_t *);
19 __END_DECLS
20 
21 #endif
___add8_set_overflow_flag
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
Definition: add.c:62
CARRY
#define CARRY
bit position of CARRY flag
Definition: z80.h:72
memory
z80 memory class
Definition: memory.h:19
z80::pc
word pc
Definition: z80.h:53
_add_reg16_reg16
void _add_reg16_reg16(word *, word *, struct z80 *)
adds two 16-bit registers together, storing the values in reg1
Definition: add.c:180
add.h
ZERO
#define ZERO
bit position of ZERO flag
Definition: z80.h:78
_add_a_reg8
void _add_a_reg8(struct z80 *, uint8_t *)
adds the contents of a user supplied register to A
Definition: add.c:129
_add_a_mem
void _add_a_mem(struct z80 *, uint8_t *)
adds the contents of a user supplied register to A
Definition: add.c:153
___add8_set_sign_flag
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
Definition: add.c:79
PARITY_OVERFLOW
#define PARITY_OVERFLOW
bit position of OVERFLOW flag
Definition: z80.h:74
z80
Definition: z80.h:51
_adc_a_mem
void _adc_a_mem(struct z80 *cpu, uint8_t *memory)
adds contents of A to the contents of a memory address with carry
Definition: add.c:167
utils.h
Utility macros.
_adc_a_mem
void _adc_a_mem(struct z80 *, uint8_t *)
adds contents of A to the contents of a memory address with carry
Definition: add.c:167
HALF_CARRY
#define HALF_CARRY
bit position of HALF CARRY flag
Definition: z80.h:76
z80.h
z80 CPU data structure and functions
SIGN
#define SIGN
bit position of SIGN flag
Definition: z80.h:79
__add8_set_flags
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
Definition: add.c:112
word::l
uint8_t l
low order byte
Definition: z80.h:31
_inc8
__BEGIN_DECLS void _inc8(uint8_t *, struct z80 *)
increments an 8 bit register
Definition: add.c:202
word::h
uint8_t h
high order byte
Definition: z80.h:32
word::B
struct word::@0 B
Combination of High and Low bytes in correct order for endianness.
_add_a_reg8
void _add_a_reg8(struct z80 *cpu, uint8_t *reg)
adds the contents of a user supplied register to A
Definition: add.c:129
_add_reg16_reg16
void _add_reg16_reg16(word *reg1, word *reg2, struct z80 *cpu)
adds two 16-bit registers together, storing the values in reg1
Definition: add.c:180
RESET
#define RESET(val, bit)
Resets a bit.
Definition: utils.h:31
z80::af
word af
Definition: z80.h:54
_adc_a_reg8
void _adc_a_reg8(struct z80 *, uint8_t *)
adds the contents of a user supplied register and the carry flag to A
Definition: add.c:141
___add8_set_carry_flag
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
Definition: add.c:28
word::W
uint16_t W
16-bit pair
Definition: z80.h:22
_inc8
void _inc8(uint8_t *n, struct z80 *cpu)
increments an 8 bit register
Definition: add.c:202
SUBTRACT
#define SUBTRACT
bit position of SUBTRACT flag
Definition: z80.h:73
word
type to deal with endianness and access of high/low bits
Definition: z80.h:21
IS_SET
#define IS_SET(val, bit)
Determines if a bit is set or not.
Definition: utils.h:17
_adc_a_reg8
void _adc_a_reg8(struct z80 *cpu, uint8_t *reg)
adds the contents of a user supplied register and the carry flag to A
Definition: add.c:141
___add8_set_half_carry_flag
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
Definition: add.c:96
_add_a_mem
void _add_a_mem(struct z80 *cpu, uint8_t *memory)
adds the contents of a user supplied register to A
Definition: add.c:153
___add8_set_zero_flag
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
Definition: add.c:43
memory.h
Memory setup functions.
SET
#define SET(val, bit)
Sets a bit.
Definition: utils.h:24