Jelajahi Sumber

patched reading CAS instruction

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7912 8c9fc860-2736-0410-a75d-ab315db34111
felixf 7 tahun lalu
induk
melakukan
273a8f4db2
1 mengubah file dengan 4 tambahan dan 3 penghapusan
  1. 4 3
      source/FoxAMDBackend.Mod

+ 4 - 3
source/FoxAMDBackend.Mod

@@ -2564,9 +2564,10 @@ TYPE
 			Spill(physicalRegisters.Mapped(register));
 			ra := ReservePhysicalRegister(IntermediateCode.GeneralPurposeRegister,instruction.op2.type,register,inPC);
 			IF IntermediateCode.OperandEquals (instruction.op2,instruction.op3) THEN
-				MakeOperand(instruction.op1,Low,op1,ra);
-				Assembler.InitMem(mem,SHORT(instruction.op1.type.sizeInBits DIV 8),op1.register,0);
-				emitter.Emit2(InstructionSet.opMOV,op1,mem);
+				MakeRegister(instruction.op1,Low,op1(*,ra*));
+				Assembler.InitMem(mem,SHORT(instruction.op2.type.sizeInBits DIV 8),op1.register,0);
+				TicketToOperand(ra, op2);
+				emitter.Emit2(InstructionSet.opMOV,op2,mem);
 			ELSE
 				MakeOperand(instruction.op2,Low,op2,ra);
 				MakeRegister(instruction.op1,Low,op1);