Add highlighting, fixed len instructions and more

This commit is contained in:
2025-02-09 21:15:50 +01:00
parent 45653b6372
commit e133c2df3a
17 changed files with 753 additions and 338 deletions

View File

@@ -23,13 +23,16 @@
#define CPU_MODE_STEP (1 << 4)
#define CPU_MODE_SECOND (1 << 5)
#define CPU_INSTRUCTION_SIZE 8 //Biggest instruction
// CPU state
typedef struct {
uint8_t regs[REG_COUNT];
uint8_t memory[MEM_SIZE];
uint32_t pc; // Program counter
uint32_t stack[STACK_SIZE]; // Stack pointer
uint32_t addrToLineMapper[MEM_SIZE / CPU_INSTRUCTION_SIZE];
uint32_t pc; // Program counter
uint32_t stack_ptr; // Stack pointer
uint8_t flags; // Status flags
uint8_t mode;