#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include "mem.h"

void clearMem(memory_t mem){
    memset(mem,0,256*sizeof(word_t));
}

word_t getWord(const memory_t  mem, int address){
    return mem[address];
}

void setWord(memory_t mem,int address, word_t word){
    mem[address] = word;
}

word_t getOpcode(const memory_t mem, int address){
    return mem[address];
}

void dumpMem(const memory_t  mem){
    int i;

    printf("Memory:\n");
    for (i = 0;i<MAX_MEM_SIZE;i++){
        printf("%d : %08x \n",i,mem[i]);
    }

}
