From 377a32dbed62b66f6d45589d3cae7a8253691422 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Tue, 10 Dec 2013 16:38:17 +0000 Subject: ArmPkg/ArmDisassemblerLib: Fixed logical/bitwise operator confusion Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14955 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c') diff --git a/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c b/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c index dfab4cc..fbe8949 100644 --- a/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c +++ b/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c @@ -773,17 +773,17 @@ DisassembleThumbInstruction ( case LDM_REG_INDIRECT_LSL: // , [, {, LSL #]} Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, [%a, %a", gReg[Rt], gReg[Rn], gReg[Rm]); - if (((OpCode32 >> 4) && 3) == 0) { + if (((OpCode32 >> 4) & 3) == 0) { AsciiSPrint (&Buf[Offset], Size - Offset, "]"); } else { - AsciiSPrint (&Buf[Offset], Size - Offset, ", LSL #%d]", (OpCode32 >> 4) && 3); + AsciiSPrint (&Buf[Offset], Size - Offset, ", LSL #%d]", (OpCode32 >> 4) & 3); } return; case LDM_REG_IMM12: // , [, {, #]} Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, [%a", gReg[Rt], gReg[Rn]); - if ((OpCode32 && 0xfff) == 0) { + if ((OpCode32 & 0xfff) == 0) { AsciiSPrint (&Buf[Offset], Size - Offset, "]"); } else { AsciiSPrint (&Buf[Offset], Size - Offset, ", #0x%x]", OpCode32 & 0xfff); @@ -797,7 +797,7 @@ DisassembleThumbInstruction ( P = (OpCode32 & BIT10) == BIT10; Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, [%a", gReg[Rt], gReg[Rn]); if (P) { - if ((OpCode32 && 0xff) == 0) { + if ((OpCode32 & 0xff) == 0) { AsciiSPrint (&Buf[Offset], Size - Offset, "]%a", W?"!":""); } else { AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x]%a", U?"":"-" , OpCode32 & 0xff, W?"!":""); @@ -814,13 +814,13 @@ DisassembleThumbInstruction ( W = (OpCode32 & BIT21) == BIT21; Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, [%a", gReg[Rt], gReg[Rt2], gReg[Rn]); if (P) { - if ((OpCode32 && 0xff) == 0) { + if ((OpCode32 & 0xff) == 0) { AsciiSPrint (&Buf[Offset], Size - Offset, "]"); } else { AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x]%a", U?"":"-", (OpCode32 & 0xff) << 2, W?"!":""); } } else { - if ((OpCode32 && 0xff) != 0) { + if ((OpCode32 & 0xff) != 0) { AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x", U?"":"-", (OpCode32 & 0xff) << 2); } } -- cgit v1.1