criscv/include/cpu.h
Minecon724 0e9a116bad
All checks were successful
/ deploy (push) Successful in 1m19s
Finally move showing registers to a function
Also added a cool frame
2024-10-20 11:53:06 +02:00

24 lines
No EOL
457 B
C

#ifndef CPU_H
#define CPU_H
#include "address_space.h"
#include <stdint.h>
struct CPU_s {
// [32] of 32bit (uint32_t) registers
uint32_t registers[32];
// Points to the byte of current instruction. Also known as pc
uint32_t programCounter;
// The address space
AddressSpace *addressSpace;
};
typedef struct CPU_s CPU;
CPU create_cpu(AddressSpace *addressSpace);
int cpu_cycle(CPU *cpu);
void print_registers(CPU *cpu);
#endif