PZ80emu  0.1
sub.h
Go to the documentation of this file.
1 
6 #ifndef __PZ80EMU_SUB__
7 #define __PZ80EMU_SUB__
8 
9 #include "z80.h"
10 
11 __BEGIN_DECLS
12 void _dec8(uint8_t *, struct z80 *);
13 void _sub_a_reg8(struct z80 *, uint8_t *);
14 void _sub_a_mem(struct z80 *, uint8_t *);
15 void _sbc_a_reg8(struct z80 *, uint8_t *);
16 void _cp(uint8_t *, struct z80 *);
17 __END_DECLS
18 
19 #endif
___sub8_set_sign_flag
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
CARRY
#define CARRY
bit position of CARRY flag
Definition: z80.h:72
sub.h
_cp
void _cp(uint8_t *, struct z80 *)
set flags as if operand was subtracted from A
Definition: sub.c:122
memory
z80 memory class
Definition: memory.h:19
z80::pc
word pc
Definition: z80.h:53
_sub_a_mem
void _sub_a_mem(struct z80 *, uint8_t *)
subtracts the contents of a memory address from the A register
Definition: sub.c:145
_sub_a_mem
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
_dec8
__BEGIN_DECLS void _dec8(uint8_t *, struct z80 *)
decrements an 8-bit register
Definition: sub.c:175
__sub8_set_flags
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
ZERO
#define ZERO
bit position of ZERO flag
Definition: z80.h:78
PARITY_OVERFLOW
#define PARITY_OVERFLOW
bit position of OVERFLOW flag
Definition: z80.h:74
z80
Definition: z80.h:51
_sub_a_reg8
void _sub_a_reg8(struct z80 *, uint8_t *)
subtracts reg from the A register
Definition: sub.c:133
utils.h
Utility macros.
___sub8_set_carry_flag
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
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
_cp
void _cp(uint8_t *reg, struct z80 *cpu)
set flags as if operand was subtracted from A
Definition: sub.c:122
word::l
uint8_t l
low order byte
Definition: z80.h:31
___sub8_set_half_carry_flag
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
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.
_sub_a_reg8
void _sub_a_reg8(struct z80 *cpu, uint8_t *reg)
subtracts reg from the A register
Definition: sub.c:133
RESET
#define RESET(val, bit)
Resets a bit.
Definition: utils.h:31
z80::af
word af
Definition: z80.h:54
word::W
uint16_t W
16-bit pair
Definition: z80.h:22
_sbc_a_reg8
void _sbc_a_reg8(struct z80 *, uint8_t *)
subtracts an 8-bit register from the A register with carry
Definition: sub.c:159
_sbc_a_reg8
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
___sub8_set_zero_flag
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
___sub8_set_overflow_flag
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
SUBTRACT
#define SUBTRACT
bit position of SUBTRACT flag
Definition: z80.h:73
IS_SET
#define IS_SET(val, bit)
Determines if a bit is set or not.
Definition: utils.h:17
_dec8
void _dec8(uint8_t *n, struct z80 *cpu)
decrements an 8-bit register
Definition: sub.c:175
SET
#define SET(val, bit)
Sets a bit.
Definition: utils.h:24