From 7081ff044544540525d971fe53db9217f340a8ed Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 9 Jul 2001 14:22:11 +0000 Subject: [PATCH] 2001-07-09 Andreas Jaeger , Karsten Keil * i386-dis.c (set_op): Handle 64 bit and 32 bit mode. (OP_J): Use bfd_vma for mask to work properly with 64 bits. (op_address,op_riprel): Use bfd_vma to handle 64 bits. --- opcodes/ChangeLog | 6 ++++++ opcodes/i386-dis.c | 23 ++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 4df56fb857..2953237b6c 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2001-07-09 Andreas Jaeger , Karsten Keil + + * i386-dis.c (set_op): Handle 64 bit and 32 bit mode. + (OP_J): Use bfd_vma for mask to work properly with 64 bits. + (op_address,op_riprel): Use bfd_vma to handle 64 bits. + 2001-07-05 Ben Elliston * Makefile.am (CPUDIR): Define. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 363fe4ef60..d5eacd29e5 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -67,7 +67,7 @@ static bfd_vma get64 PARAMS ((void)); static bfd_signed_vma get32 PARAMS ((void)); static bfd_signed_vma get32s PARAMS ((void)); static int get16 PARAMS ((void)); -static void set_op PARAMS ((unsigned int, int)); +static void set_op PARAMS ((bfd_vma, int)); static void OP_REG PARAMS ((int, int)); static void OP_IMREG PARAMS ((int, int)); static void OP_I PARAMS ((int, int)); @@ -1786,8 +1786,8 @@ prefix_name (pref, sizeflag) static char op1out[100], op2out[100], op3out[100]; static int op_ad, op_index[3]; -static unsigned int op_address[3]; -static unsigned int op_riprel[3]; +static bfd_vma op_address[3]; +static bfd_vma op_riprel[3]; static bfd_vma start_pc; @@ -3238,12 +3238,21 @@ get16 () static void set_op (op, riprel) - unsigned int op; + bfd_vma op; int riprel; { op_index[op_ad] = op_ad; - op_address[op_ad] = op; - op_riprel[op_ad] = riprel; + if (mode_64bit) + { + op_address[op_ad] = op; + op_riprel[op_ad] = riprel; + } + else + { + /* Mask to get a 32-bit address. */ + op_address[op_ad] = op & 0xffffffff; + op_riprel[op_ad] = riprel & 0xffffffff; + } } static void @@ -3515,7 +3524,7 @@ OP_J (bytemode, sizeflag) int sizeflag; { bfd_vma disp; - int mask = -1; + bfd_vma mask = -1; switch (bytemode) { -- 2.34.1