16 #define UNUSED __attribute__((unused))
42 # define ALL_BUT_AUX_FLAG (SIGN_FLAG | ZERO_FLAG | PARITY_FLAG | CARRY_FLAG)
96 uint8_t (*IN_Func)(uint8_t);
97 void (*OUT_Func)(uint8_t, uint8_t);
condition_flags
different condition checks for JMP, conditional OPS
Definition: cpu_8080.h:48
@ P_check
Definition: cpu_8080.h:55
@ NC_check
Definition: cpu_8080.h:51
@ PO_check
Definition: cpu_8080.h:53
@ NZ_check
Definition: cpu_8080.h:49
@ M_check
Definition: cpu_8080.h:56
@ C_check
Definition: cpu_8080.h:52
@ Z_check
Definition: cpu_8080.h:50
@ PE_check
Definition: cpu_8080.h:54
void io_machine_OUT(uint8_t port, uint8_t data)
Function to write data to the IO port.
flag_bits
ENUMS for PSW_FLAGS.
Definition: cpu_8080.h:34
void print_state(const cpu_state cpu)
Print the state of CPU.
Definition: cpu_8080.c:113
cpu_state * init_cpu_8080(uint16_t pc, uint8_t(*in_cb)(uint8_t), void(*out_cb)(uint8_t, uint8_t))
Initialize a new cpu_8080 instance structure. Everything is initialized to 0.
Definition: cpu_8080.c:18
int decompile_inst(cpu_state *cpu, uint16_t *next_inst)
Recompile mode.
Definition: cpu_8080.c:69
int exec_inst(cpu_state *cpu)
Executes the instruction pc is pointing to after incrementing it.
Definition: cpu_8080.c:36
uint8_t io_machine_IN(uint8_t port)
Function to read a byte of data from the port.
Memory abstraction for 8080 cpu.
cpu_state: This structure keeps runtime state of all the registers in the CPU.
Definition: cpu_8080.h:63
uint16_t SP
Definition: cpu_8080.h:88
uint8_t D
Definition: cpu_8080.h:71
uint16_t rom_size
Definition: cpu_8080.h:103
uint16_t BC
Definition: cpu_8080.h:76
uint8_t H
Definition: cpu_8080.h:73
uint8_t L
Definition: cpu_8080.h:72
uint8_t pend_intt
Definition: cpu_8080.h:91
uint8_t E
Definition: cpu_8080.h:70
uint16_t HL
Definition: cpu_8080.h:78
program_status_word PSW
Definition: cpu_8080.h:84
v_memory mem
Definition: cpu_8080.h:102
uint8_t ACC
Definition: cpu_8080.h:83
uint16_t DE
Definition: cpu_8080.h:77
uint8_t intt
Definition: cpu_8080.h:90
uint8_t B
Definition: cpu_8080.h:69
uint8_t halt
Definition: cpu_8080.h:104
uint16_t PC
Definition: cpu_8080.h:89
uint8_t C
Definition: cpu_8080.h:68
program_status_word: An exdended PSW for easy checks and sets of PSW without flagging.
Definition: cpu_8080.h:22
uint8_t aux
Definition: cpu_8080.h:24
uint8_t zero
Definition: cpu_8080.h:26
uint8_t carry
Definition: cpu_8080.h:23
uint8_t sign
Definition: cpu_8080.h:25
uint8_t parity
Definition: cpu_8080.h:27
Memory wrapper.
Definition: memory_8080.h:18