/// <summary> /// Decodes and emites the given J-format instruction /// </summary> /// <param name="index">The index of the instruction</param> /// <param name="instructionData">The instruction data</param> /// <param name="generatorData">The generator data</param> /// <param name="emiter">The emiter</param> private void DecodeAndEmitJFormat(int index, int instructionData, MethodGeneratorData generatorData, InstructionEmiter emiter) { //Decode and execute it JFormatInstruction instruction = JFormatInstruction.Decode(instructionData); emiter.JFormatInstructionEmiter(index, instruction, generatorData); }
public void TestJFormat() { JFormatInstruction test = new JFormatInstruction(45, 4325357); JFormatInstruction decodedTest = JFormatInstruction.Decode(test.Encode()); Assert.AreEqual(test.OpCode, decodedTest.OpCode); Assert.AreEqual(test.Immediate, decodedTest.Immediate); Assert.AreEqual(45, decodedTest.OpCode); Assert.AreEqual(4325357, decodedTest.Immediate); }