-
Notifications
You must be signed in to change notification settings - Fork 3
/
segment.h
80 lines (56 loc) · 1.45 KB
/
segment.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef INCLUDE_SEGMENT_H
#define INCLUDE_SEGMENT_H
// segment.h
// Revision 11-oct-2006
#include "value.h"
//*********************************************************
// class Segment
//*********************************************************
namespace pasmo {
namespace impl {
class Segment {
public:
Segment ();
void clear ();
bool empty () const;
void setbase (address base_n);
void setsize (address size_n);
address getbase () const;
address getsize () const;
address getminused () const;
address getmaxused () const;
void setbyte (address pos, byte b);
void setword (address pos, address value);
void offsetword (address pos, address value);
byte getbyte (address pos) const;
address getword (address pos) const;
void setpos (address pos);
void setorg (address pos);
address getpos () const;
bool hasorg () const;
address getorg () const;
void putbyte (byte b);
void putword (address value);
void evallimits ();
typedef byte * byte_iterator;
typedef const byte * byte_const_iterator;
byte_iterator iter (address pos);
byte_const_iterator iter (address pos) const;
void write (ostream & out, address pos, size_t size);
void copy (Segment & dest);
private:
static const size_t max_seg_size= 65536;
byte mem [max_seg_size];
address minused;
address maxused;
address curpos;
address base;
//address size;
size_t size;
address org_addr;
bool has_org;
};
} // namespace impl
} // namespace pasmo
#endif
// End of segment.h