stack pointer and memsize

This commit is contained in:
inixyz
2023-10-13 23:53:41 +03:00
parent 0c5d5e4b1b
commit 060c0de0f3
2 changed files with 3 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ typedef int16_t i16;
typedef int32_t i32;
typedef struct{
u32 regs[32], pc;
u32 regs[32], pc, mem_size;
u8* mem;
}trv_cpu;
@@ -174,6 +174,7 @@ void trv_step(trv_cpu* cpu){
}
void trv_init(trv_cpu* cpu){
cpu->regs[2] = trv_MEM_OFFSET + cpu->mem_size;
cpu->pc = trv_MEM_OFFSET;
}