mirror of
https://github.com/creeperlv/SVM.git
synced 2026-01-11 12:59:54 +00:00
Finished basic Assembler and Linker framework.
This commit is contained in:
21
src/SVM.Assembler.Core/ISADefinition.cs
Normal file
21
src/SVM.Assembler.Core/ISADefinition.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using SVM.Core;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SVM.Assembler.Core
|
||||
{
|
||||
public class ISADefinition
|
||||
{
|
||||
public Dictionary<string, InstructionDefinition> InstructionDefinitions = new Dictionary<string, InstructionDefinition>();
|
||||
public Dictionary<PrimaryInstruction, LinkerFunction> LinkerFunctions = new Dictionary<PrimaryInstruction, LinkerFunction>();
|
||||
public void Init()
|
||||
{
|
||||
foreach (var item in InstructionDefinitions)
|
||||
{
|
||||
if (!LinkerFunctions.TryAdd(item.Value.PrimaryInstruction, item.Value.linkerFunction))
|
||||
{
|
||||
LinkerFunctions[item.Value.PrimaryInstruction] = item.Value.linkerFunction;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user