22 lines
393 B
C
22 lines
393 B
C
|
//
|
||
|
// Created by william on 30/09/23.
|
||
|
//
|
||
|
|
||
|
#include "ram.h"
|
||
|
#include "../include/cpu.h"
|
||
|
|
||
|
byte ram[MEM_RAM_AMOUNT];
|
||
|
|
||
|
void ram_set_byte(address addr, byte byte) {
|
||
|
ram[addr] = byte;
|
||
|
}
|
||
|
|
||
|
byte ram_get_byte(address addr) {
|
||
|
return ram[addr];
|
||
|
}
|
||
|
|
||
|
word ram_get_word(address addr) {
|
||
|
word word = ram_get_byte(addr);
|
||
|
word += ram_get_byte(addr + 1) << 8; // Little endian
|
||
|
return word;
|
||
|
}
|