initial commit
This commit is contained in:
22
src/memory.h
Normal file
22
src/memory.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include "instruction.h"
|
||||
|
||||
#define MEM_CALL_STACK_OFFSET 0x00000FFF
|
||||
#define MEM_PROGRAM_START 0x00001000
|
||||
#define MEM_PROGRAM_END 0x0000FFFF
|
||||
#define MEM_GP_START 0x00010000
|
||||
|
||||
// -- TYPES -- //
|
||||
typedef struct {
|
||||
uint32_t size;
|
||||
uint8_t* data;
|
||||
} Memory;
|
||||
|
||||
// -- FUNCTIONS -- //
|
||||
Memory* initMemory(uint32_t size);
|
||||
uint16_t memoryLoadWord(Memory* m, uint32_t address);
|
||||
void memorySaveWord(Memory* m, uint32_t address, uint16_t value);
|
||||
Instruction decodeInstruction(Memory* m, uint32_t pc);
|
||||
Reference in New Issue
Block a user