Пример #1
0
        public void GenerateLiteralDc()
        {
            ProgramInstruction target   = ProgramInstructionTest.Make(MnemonicDef.LD, "GR1,=1234,GR2");
            LabelTable         lblTable = new LabelTable();
            String             actual   = target.GenerateLiteralDc(lblTable);
            String             expected = ProgramLineTest.MakeGeneratedLine("LTRL0001", "DC", "1234");

            Assert.AreEqual(expected, actual, "リテラルの DC 命令が生成される");
        }
Пример #2
0
        private void CheckReadOperand(String text, Boolean success, Label expected, String message)
        {
            AsmStartInstruction target = new AsmStartInstruction();

            ProgramInstructionTest.CheckReadOperand(target, text, success, message);
            if (success)
            {
                Label actual = target.ExecStartAddress.Label;
                LabelTest.Check(expected, actual, message);
            }
        }
        private void CheckReadOperand(
            String text, Boolean success, Constant[] expectedConstants, String message)
        {
            AsmDcInstruction target = new AsmDcInstruction();

            ProgramInstructionTest.CheckReadOperand(target, text, success, message);
            if (success)
            {
                ConstantCollection actualConstants = target.Constants;
                ConstantCollectionTest.Check(expectedConstants, actualConstants, message);
            }
        }
        private void CheckReadOperand(
            String text, Boolean success, Int32 expectedValue, String message)
        {
            AsmDsInstruction target = new AsmDsInstruction();

            ProgramInstructionTest.CheckReadOperand(target, text, success, message);
            if (success)
            {
                WordCount expected = WordCount.MakeForUnitTest(expectedValue);
                WordCount actual   = target.WordCount;
                WordCountTest.Check(expected, actual, message);
            }
        }
        private void CheckReadOperand(
            String text, Boolean success,
            Label expectedAreaSpecBuffer, Label expectedAreaSpecLength, String message)
        {
            MacroInOutInstruction actual = MacroInOutInstruction.MakeIn();

            ProgramInstructionTest.CheckReadOperand(actual, text, success, message);
            if (success)
            {
                LabelTest.Check(expectedAreaSpecBuffer, actual.AreaSpec.Buffer, message);
                LabelTest.Check(expectedAreaSpecLength, actual.AreaSpec.Length, message);
            }
        }
        private void CheckReadOperand(String text, Boolean success, String message)
        {
            AsmEndInstruction target = new AsmEndInstruction();

            ProgramInstructionTest.CheckReadOperand(target, text, success, message);
        }
Пример #7
0
        private void CheckReadOperand_NoOperand(String text, Boolean success, String message)
        {
            MachineInstruction target = MachineInstruction.MakeNoOperand(Mnemonic, Opcode1);

            ProgramInstructionTest.CheckReadOperand(target, text, success, message);
        }
Пример #8
0
 public void TestInitialize()
 {
     m_rAdrXOrR1R2_RAdrX = ProgramInstructionTest.Make(MnemonicDef.LD, "GR1,#ABCD,GR2");
     m_rAdrXOrR1R2_R1R2  = ProgramInstructionTest.Make(MnemonicDef.LD, "GR3,GR4");
 }