-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmem.h
More file actions
32 lines (22 loc) · 664 Bytes
/
Copy pathmem.h
File metadata and controls
32 lines (22 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef __mem__h
#define __mem__h
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Pair{
unsigned int addr;
unsigned int value;
};
struct Mem{
struct Pair ** mem;
int max;
int len;
};
void init(struct Mem * m, int max_value);
unsigned int get_byte(struct Mem * m, unsigned int addr);
void write_byte(struct Mem * m, unsigned int addr, unsigned int value);
unsigned int get_half_word(struct Mem * m, unsigned int addr);
unsigned int get_word(struct Mem * m, unsigned int addr);
void write_half_word(struct Mem * m, unsigned int addr, unsigned int value);
void write_word(struct Mem * m, unsigned int addr, unsigned int value);
#endif