private void resolveLabels()
{
long physicalAddress = 0;
Scope parentScope = _globalScope;
foreach (var scope in parentScope.Children)
{
parentScope.Labels[scope.Name] = physicalAddress;
foreach (var instruction in scope.Statements)
{
if (!String.IsNullOrEmpty(instruction.AssociatedLabel))
{
scope.Labels[instruction.AssociatedLabel] = physicalAddress;
}
physicalAddress += instruction.ComputeSize();
}
}
}