#ifndef MEMORY_H #define MEMORY_H #include enum { MEMORY_SIZE = 65535 }; typedef struct memory_t { uint8_t cell[MEMORY_SIZE]; uint8_t (*read)( struct memory_t *memory, uint16_t addr ); void (*write)( struct memory_t *memory, uint16_t addr, uint8_t data ); } memory_t; void memory_init( memory_t *memory ); uint8_t memory_read( memory_t *memory, uint16_t addr ); void memory_write( memory_t *memory, uint16_t addr, uint8_t data ); void memory_load( memory_t *memory, uint16_t addr, uint16_t size, const char *filename ); #endif