瀏覽代碼

Patched an issue with the dissasembler (did not take into account decrement flag for operands)

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6367 8c9fc860-2736-0410-a75d-ab315db34111
felixf 9 年之前
父節點
當前提交
0dc1dc593e
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      source/FoxARMInstructionSet.Mod

+ 5 - 1
source/FoxARMInstructionSet.Mod

@@ -2862,7 +2862,11 @@ CONST
 						(* LDR? ..., [PC, #...] or STR? ..., [PC, #...] *)
 						ASSERT(instruction.operands[1].mode = modeMemory);
 						IF (instruction.operands[1].register = PC) & (instruction.operands[1].offsetRegister = None) THEN
-							value := instruction.operands[1].offsetImmediate + adr + 8;
+							IF Decrement IN instruction.operands[1].indexing THEN 
+								value := -instruction.operands[1].offsetImmediate + adr + 8;
+							ELSE
+								value := instruction.operands[1].offsetImmediate + adr + 8;
+							END;
 							WriteReference(value, TRUE, w);
 							IF value * 8 + 32 < bitSet.GetSize() THEN
 								WriteReference(bitSet.GetBits(value * 8, 32) - codeDisplacement, TRUE, w); (* note that data references cannot be resolved like this *)