fix
Some checks failed
/ deploy (push) Failing after 57s

This commit is contained in:
Minecon724 2024-10-19 16:48:00 +02:00
parent 23e861ad54
commit bf59ce8dcd
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
2 changed files with 8 additions and 13 deletions

View file

@ -5,8 +5,13 @@
#include <stdint.h> #include <stdint.h>
struct CPU_s { struct CPU_s {
// [32] of 32bit (uint32_t) registers
uint32_t registers[32]; uint32_t registers[32];
// Points to the byte of current instruction. Also known as pc
uint32_t programCounter; uint32_t programCounter;
// The address space
AddressSpace *addressSpace; AddressSpace *addressSpace;
}; };

View file

@ -1,25 +1,15 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include "cpu.h" // for structs
#include "address_space.h" #include "address_space.h"
#include "instruction_executor.h" #include "instruction_executor.h"
struct CPU_s { const CPU cpu_default = {
// [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;
} cpu_default = {
.registers = {0}, .registers = {0},
.programCounter = 0 .programCounter = 0
}; };
typedef struct CPU_s CPU;
CPU create_cpu(AddressSpace *addressSpace) { CPU create_cpu(AddressSpace *addressSpace) {
CPU cpu = cpu_default; CPU cpu = cpu_default;
cpu.addressSpace = addressSpace; cpu.addressSpace = addressSpace;