forked from CosmosOS/Cosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Assembler.cs
36 lines (32 loc) · 1.09 KB
/
Assembler.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.IL2CPU.Profiler {
public class Assembler : Cosmos.IL2CPU.AppAssembler
{
public Assembler(string assemblerLogFile)
: base(0, assemblerLogFile)
{
}
protected override void InitILOps(Type aAssemblerBaseOp)
{
var xILOp = new ILOp(this.Assembler);
DebugInfo = new Debug.Common.DebugInfo(AppDomain.CurrentDomain.BaseDirectory + "DebugInfo.mdf", true, true);
// Don't change the type in the foreach to a var, its necessary as it is now
// to typecast it, so we can then recast to an int.
foreach (ILOpCode.Code xCode in Enum.GetValues(typeof(ILOpCode.Code)))
{
int xCodeValue = (int)xCode;
if (xCodeValue <= 0xFF)
{
mILOpsLo[xCodeValue] = xILOp;
}
else
{
mILOpsHi[xCodeValue & 0xFF] = xILOp;
}
}
}
}
}