Go to the documentation of this file.
5 #ifndef __PZ80EMU_INTERPRETER__
6 #define __PZ80EMU_INTERPRETER__
word sp
Definition: z80.h:65
#define CARRY
bit position of CARRY flag
Definition: z80.h:72
void _and(uint8_t *reg, struct z80 *cpu)
Definition: boolean.c:15
void _xor(uint8_t *reg, struct z80 *cpu)
Definition: boolean.c:30
void _load_reg16_nn(word *reg, uint8_t *memory, word *pc)
Definition: load.c:92
z80 memory class
Definition: memory.h:19
void _load_idx_offset_n(word *index_register, uint8_t *memory, word *pc)
Definition: load.c:45
word pc
Definition: z80.h:53
word ix
Definition: z80.h:58
void _ret(struct z80 *cpu, uint8_t *memory)
return from a call
Definition: stack.c:50
void _push(word *reg, struct z80 *cpu, uint8_t *memory)
pushes the value of a register to the stack
Definition: stack.c:138
static void __iy_instruction(struct z80 *cpu, uint8_t *memory)
parses an opcode from the IY instruction set
Definition: interpreter.c:87
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
void _rrca(struct z80 *cpu)
register A 8-bit right rotate with carry
Definition: rotate.c:31
#define ZERO
bit position of ZERO flag
Definition: z80.h:78
void _call_nn(struct z80 *cpu, uint8_t *memory)
calls the function at memory address NN
Definition: stack.c:117
void _di(struct z80 *cpu)
disable interrupts
Definition: interrupt.c:13
void _ex_sp_reg16(word *reg, struct z80 *cpu, uint8_t *memory)
Definition: exchange.c:41
void _djnz_n(struct z80 *cpu, uint8_t *memory)
decrements B, then jumps to the provided memory address if B is 0
Definition: jump.c:15
word ir
Definition: z80.h:60
#define PARITY_OVERFLOW
bit position of OVERFLOW flag
Definition: z80.h:74
void _daa(struct z80 *cpu)
Definition: bcd.c:15
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
void _ret_flag(struct z80 *cpu, uint8_t *memory, int flag, bool n)
returns from a call based on state of CPU flag
Definition: stack.c:17
void _load_mem_idx_offset_reg8(uint8_t *reg, word *index_register, uint8_t *memory, word *pc)
Definition: load.c:32
z80 CPU data structure and functions
#define SIGN
bit position of SIGN flag
Definition: z80.h:79
void _jr(struct z80 *cpu, uint8_t *memory, int flag, bool n)
adds n to PC if provided conditions are met
Definition: jump.c:37
void _scf(struct z80 *cpu)
Definition: complement.c:14
void _cp(uint8_t *reg, struct z80 *cpu)
set flags as if operand was subtracted from A
Definition: sub.c:122
void _jp_flag_nn(struct z80 *cpu, uint8_t *memory, int flag, bool n)
jumps to N if provided conditions are met
Definition: jump.c:82
word _af
Definition: z80.h:61
word bc
Definition: z80.h:55
void _rlc(uint8_t n, struct z80 *cpu)
8-bit rotation to the left
Definition: rotate.c:16
void _in_reg8_mem(uint8_t *reg, struct z80 *cpu, uint8_t *memory)
reads value of data bus into an 8-bit register
Definition: io.c:43
uint8_t l
low order byte
Definition: z80.h:31
uint8_t h
high order byte
Definition: z80.h:32
static void __ix_instruction(struct z80 *cpu, uint8_t *memory)
parses an opcode from the IX instruction set
Definition: interpreter.c:50
struct word::@0 B
Combination of High and Low bytes in correct order for endianness.
void _out_mem_reg8(uint8_t reg, struct z80 *cpu, uint8_t *memory)
places the contents of an 8-bit register on the databus
Definition: io.c:15
void _or(uint8_t *reg, struct z80 *cpu)
Definition: boolean.c:45
void _add_a_reg8(struct z80 *cpu, uint8_t *reg)
adds the contents of a user supplied register to A
Definition: add.c:129
void _pop(word *reg, struct z80 *cpu, uint8_t *memory)
pop a value off the stack into a register
Definition: stack.c:69
void _ex_reg16(word *reg1, word *reg2)
Definition: exchange.c:13
void _sub_a_reg8(struct z80 *cpu, uint8_t *reg)
subtracts reg from the A register
Definition: sub.c:133
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
static void __bits_instruction(struct z80 *cpu, uint8_t *memory)
parses an opcode from the BITS instruction set
Definition: interpreter.c:33
void _load_reg8_mem_idx_offset(uint8_t *reg, word *index_register, uint8_t *memory, word *pc)
Definition: load.c:17
void _rst(struct z80 *cpu, uint8_t *memory, uint16_t pc)
saves PC to the stack, then sets a new PC
Definition: stack.c:153
void _jp_reg(word *reg, struct z80 *cpu)
jumps to the value stored in reg
Definition: jump.c:109
word af
Definition: z80.h:54
void _jp_nn(struct z80 *cpu, uint8_t *memory)
jumps to an arbitrary memory address
Definition: jump.c:62
void _ccf(struct z80 *cpu)
Definition: complement.c:26
__BEGIN_DECLS void _instruction(struct z80 *, uint8_t *)
parses an opcode from the main instruction set
Definition: interpreter.c:158
static void __extended_instruction(struct z80 *cpu, uint8_t *memory)
parses an opcode from the extended instruction set
Definition: interpreter.c:125
uint16_t W
16-bit pair
Definition: z80.h:22
void _load_mem_a(struct z80 *cpu, uint8_t *memory)
loads the value of A into a user provided memory location
Definition: load.c:75
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
word iy
Definition: z80.h:59
void _inc8(uint8_t *n, struct z80 *cpu)
increments an 8 bit register
Definition: add.c:202
void _call_flag_nn(struct z80 *cpu, uint8_t *memory, int flag, bool n)
make a function call based on status of CPU flags
Definition: stack.c:85
word de
Definition: z80.h:56
#define IS_SET(val, bit)
Determines if a bit is set or not.
Definition: utils.h:17
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
void _load_a_mem(struct z80 *cpu, uint8_t *memory)
loads user provided value from memory into register A
Definition: load.c:59
void _exx(struct z80 *cpu)
Definition: exchange.c:27
void _add_a_mem(struct z80 *cpu, uint8_t *memory)
adds the contents of a user supplied register to A
Definition: add.c:153
void _ei(struct z80 *cpu)
enable interrupts
Definition: interrupt.c:24
void _load_mem_reg16(word *reg, uint8_t *memory, word *pc)
loads a 16-bit register pair with a user-provided value from memory
Definition: load.c:110
void _dec8(uint8_t *n, struct z80 *cpu)
decrements an 8-bit register
Definition: sub.c:175
word hl
Definition: z80.h:57
void _instruction(struct z80 *cpu, uint8_t *memory)
parses an opcode from the main instruction set
Definition: interpreter.c:158
void _load_reg16_mem(word *reg, uint8_t *memory, word *pc)
loads a user-provided value from memory into a 16-bit register pair
Definition: load.c:129