X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPkg%2FLibrary%2FArmDisassemblerLib%2FThumbDisassembler.c;fp=ArmPkg%2FLibrary%2FArmDisassemblerLib%2FThumbDisassembler.c;h=108cda9442983b10575ea7a5fd5f6da17a346552;hp=fbe8949d7de4738417c63e39c6d78cf7ac112f21;hb=3402aac7d985bf8a9f9d3c639f3fe93609380513;hpb=62d441fb17d59958bf00c4a1f3b52bf6a0b40b24 diff --git a/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c b/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c index fbe8949d7d..108cda9442 100644 --- a/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c +++ b/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c @@ -1,15 +1,15 @@ /** @file Thumb Dissassembler. Still a work in progress. - Wrong output is a bug, so please fix it. + Wrong output is a bug, so please fix it. Hex output means there is not yet an entry or a decode bug. - gOpThumb[] are Thumb 16-bit, and gOpThumb2[] work on the 32-bit - 16-bit stream of Thumb2 instruction. Then there are big case + gOpThumb[] are Thumb 16-bit, and gOpThumb2[] work on the 32-bit + 16-bit stream of Thumb2 instruction. Then there are big case statements to print everything out. If you are adding instructions try to reuse existing case entries if possible. Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
- + This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -32,13 +32,13 @@ extern CHAR8 *gReg[]; // Thumb address modes #define LOAD_STORE_FORMAT1 1 #define LOAD_STORE_FORMAT1_H 101 -#define LOAD_STORE_FORMAT1_B 111 +#define LOAD_STORE_FORMAT1_B 111 #define LOAD_STORE_FORMAT2 2 #define LOAD_STORE_FORMAT3 3 #define LOAD_STORE_FORMAT4 4 -#define LOAD_STORE_MULTIPLE_FORMAT1 5 -#define PUSH_FORMAT 6 -#define POP_FORMAT 106 +#define LOAD_STORE_MULTIPLE_FORMAT1 5 +#define PUSH_FORMAT 6 +#define POP_FORMAT 106 #define IMMED_8 7 #define CONDITIONAL_BRANCH 8 #define UNCONDITIONAL_BRANCH 9 @@ -93,8 +93,8 @@ extern CHAR8 *gReg[]; #define THUMB2_4REGS 230 #define ADD_IMM12_1REG 231 #define THUMB2_IMM16 232 -#define MRC_THUMB2 233 -#define MRRC_THUMB2 234 +#define MRC_THUMB2 233 +#define MRRC_THUMB2 234 #define THUMB2_MRS 235 #define THUMB2_MSR 236 @@ -118,7 +118,7 @@ THUMB_INSTRUCTIONS gOpThumb[] = { { "ADD" , 0x1800, 0xfe00, DATA_FORMAT1 }, { "ADD" , 0x4400, 0xff00, DATA_FORMAT8 }, // A8.6.9 { "ADD" , 0xa000, 0xf100, DATA_FORMAT6_PC }, - { "ADD" , 0xa800, 0xf800, DATA_FORMAT6_SP }, + { "ADD" , 0xa800, 0xf800, DATA_FORMAT6_SP }, { "ADD" , 0xb000, 0xff80, DATA_FORMAT7 }, { "AND" , 0x4000, 0xffc0, DATA_FORMAT5 }, @@ -156,7 +156,7 @@ THUMB_INSTRUCTIONS gOpThumb[] = { { "LDRH" , 0x7a00, 0xfe00, LOAD_STORE_FORMAT2 }, { "LDRSB" , 0x5600, 0xfe00, LOAD_STORE_FORMAT2 }, // STR , [, ] { "LDRSH" , 0x5e00, 0xfe00, LOAD_STORE_FORMAT2 }, - + { "MOVS", 0x0000, 0xffc0, DATA_FORMAT5 }, // LSL with imm5 == 0 is a MOVS, so this must go before LSL { "LSL" , 0x0000, 0xf800, DATA_FORMAT4 }, { "LSL" , 0x4080, 0xffc0, DATA_FORMAT5 }, @@ -212,8 +212,8 @@ THUMB_INSTRUCTIONS gOpThumb[] = { THUMB_INSTRUCTIONS gOpThumb2[] = { //Instruct OpCode OpCode Mask Addressig Mode - - { "ADR", 0xf2af0000, 0xfbff8000, ADR_THUMB2 }, // ADDR ,