mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-18 02:38:37 +00:00
31 lines
1017 B
Diff
31 lines
1017 B
Diff
diff --git a/arch/X86/X86ATTInstPrinter.c b/arch/X86/X86ATTInstPrinter.c
|
|
index 7e19b4e..062eef8 100644
|
|
--- a/arch/X86/X86ATTInstPrinter.c
|
|
+++ b/arch/X86/X86ATTInstPrinter.c
|
|
@@ -576,6 +576,10 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O)
|
|
if (MI->Opcode == X86_CALLpcrel16 || MI->Opcode == X86_JMP_2)
|
|
imm = imm & 0xffff;
|
|
|
|
+ if (MI->csh->mode == CS_MODE_16) {
|
|
+ imm |= (MI->address >> 16) << 16;
|
|
+ }
|
|
+
|
|
if (imm < 0) {
|
|
SStream_concat(O, "0x%"PRIx64, imm);
|
|
} else {
|
|
diff --git a/arch/X86/X86IntelInstPrinter.c b/arch/X86/X86IntelInstPrinter.c
|
|
index c455725..eb60586 100644
|
|
--- a/arch/X86/X86IntelInstPrinter.c
|
|
+++ b/arch/X86/X86IntelInstPrinter.c
|
|
@@ -756,6 +756,10 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O)
|
|
if (MI->Opcode == X86_CALLpcrel16 || MI->Opcode == X86_JMP_2)
|
|
imm = imm & 0xffff;
|
|
|
|
+ if (MI->csh->mode == CS_MODE_16) {
|
|
+ imm |= (MI->address >> 16) << 16;
|
|
+ }
|
|
+
|
|
printImm(MI->csh->syntax, O, imm, true);
|
|
|
|
if (MI->csh->detail) {
|