mirror of
https://github.com/creeperlv/SVM.git
synced 2026-01-11 12:59:54 +00:00
Hello world finally works.
Sample working code: .data: text0 "Hello, World!\n" .code: sd.int32 $4 123 sd.int32 $5 321 sd.int32 $10 1 sd.int32 $11 text0 sd.int32 $12 14 sys 4 sd.int32 $10 100 sys 1 bmath add Int32 $4 $5 $6
This commit is contained in:
@@ -16,6 +16,15 @@ namespace SVM.Assembler.Core
|
||||
IntermediateObject = intermediateObject;
|
||||
Definition = definition;
|
||||
}
|
||||
public unsafe bool TryFindData(string label, out uint offset)
|
||||
{
|
||||
if (DataOffsets.TryGetValue(label, out offset))
|
||||
{
|
||||
offset += (uint)IntermediateObject.DetermineFinalInstructionCount(this) * (uint)sizeof(SVMInstruction);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool TryFindLabel(string label, out int offset)
|
||||
{
|
||||
label = label + ":";
|
||||
|
||||
Reference in New Issue
Block a user