private void CheckGetOffset(UInt16 expectedValue, String message) { MemoryOffset expectedOffset = new MemoryOffset(expectedValue); MemoryOffset actualOffset = m_words.GetOffset(); MemoryOffsetTest.Check(expectedOffset, actualOffset, message); }
public void SetLabelOffset() { ProgramLine instructionLine = ProgramLine.Parse("LBL001 LD GR1,GR2"); LabelTable lblTable = new LabelTable(); instructionLine.RegisterLabel(lblTable); MemoryOffset offsetSet = new MemoryOffset(0xABCD); instructionLine.SetLabelOffset(lblTable, offsetSet); LabelDefinition labelDef = lblTable.GetDefinitionFor(instructionLine.Label); MemoryOffset offsetGot = labelDef.RelOffset; MemoryOffsetTest.Check( offsetSet, offsetGot, "SetLabelOffset() で設定したラベルのオフセットが取得できる"); }
internal static void Check(LabelDefinition expected, LabelDefinition actual, String message) { LabelTest.Check(expected.Label, actual.Label, "Label: " + message); MemoryOffsetTest.Check(expected.RelOffset, actual.RelOffset, "RelOffset: " + message); MemoryAddressTest.Check(expected.AbsAddress, actual.AbsAddress, "AbsAddress: " + message); }
internal static void Check(LabelReference expected, LabelReference actual, String message) { LabelTest.Check(expected.ReferringLabel, actual.ReferringLabel, "ReferringLabel: " + message); MemoryOffsetTest.Check(expected.WordOffset, actual.WordOffset, "ObjectOffset: " + message); }