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:
2025-08-01 03:43:09 +10:00
parent 269a2b51be
commit 6eb87e433e
11 changed files with 210 additions and 28 deletions

View File

@@ -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 + ":";