forked from dsenta00/BOXVM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathByteCode.h
More file actions
54 lines (45 loc) · 736 Bytes
/
Copy pathByteCode.h
File metadata and controls
54 lines (45 loc) · 736 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef BYTECODE_H
#define BYTECODE_H
#include "BoxInfo.h"
class ByteCode {
public:
ByteCode();
void InitByteCode(Bcode, Bcode);
~ByteCode();
Bcode ReadByteCode();
void SetByteCode(Bcode);
void Jump(Byte);
protected:
Bcode bytecode;
Bcode codesegment;
};
ByteCode::~ByteCode()
{
if (codesegment)
{
free(codesegment);
}
}
ByteCode::ByteCode()
{
bytecode = null;
codesegment = null;
}
void ByteCode::InitByteCode(Bcode _codesegment, Bcode _bytecode)
{
bytecode = _bytecode;
codesegment = _codesegment;
}
void ByteCode::Jump(Byte n)
{
bytecode += n;
}
Bcode ByteCode::ReadByteCode()
{
return ++bytecode;
}
void ByteCode::SetByteCode(Bcode adress)
{
bytecode = adress;
}
#endif