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