public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFA]: opcodes / i386 disassembler
@ 2000-07-20 18:41 Michael Snyder
  2000-07-20 18:59 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Snyder @ 2000-07-20 18:41 UTC (permalink / raw)
  To: binutils, gdb-patches

Would the following be acceptable?  Assuming I provided an
suitable ChangeLog entry?

Index: i386-dis.c
===================================================================
RCS file: /cvs/cvsfiles/devo/opcodes/i386-dis.c,v
retrieving revision 1.51
diff -p -r1.51 i386-dis.c
*** i386-dis.c	2000/04/05 20:16:40	1.51
--- i386-dis.c	2000/07/21 01:40:08
*************** You should have received a copy of the G
*** 18,38 ****
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  
! /*
!  * 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
!  * July 1988
!  *  modified by John Hassey (hassey@dg-rtp.dg.com)
!  */
! 
! /*
!  * The main tables describing the instructions is essentially a copy
!  * of the "Opcode Map" chapter (Appendix A) of the Intel 80386
!  * Programmers Manual.  Usually, there is a capital letter, followed
!  * by a small letter.  The capital letter tell the addressing mode,
!  * and the small letter tells about the operand size.  Refer to
!  * the Intel manual for details.
!  */
  
  #include "dis-asm.h"
  #include "sysdep.h"
  #include "opintl.h"
--- 18,34 ----
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  
! /* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
!    July 1988, modified by John Hassey (hassey@dg-rtp.dg.com).  */
  
+ /* The main tables describing the instructions is essentially a copy
+    of the "Opcode Map" chapter (Appendix A) of the Intel 80386
+    Programmers Manual and the Pentium(TM) Family User's Manual.
+    Usually, there is a capital letter, followed by a small letter.
+    The capital letter tell the addressing mode, and the small letter
+    tells about the operand size.  Refer to the Intel manual for
+    details.  */
+ 
  #include "dis-asm.h"
  #include "sysdep.h"
  #include "opintl.h"
*************** static const struct dis386 dis386_att[] 
*** 496,502 ****
    /* 80 */
    { GRP1b },
    { GRP1S },
!   { "(bad)",	XX, XX, XX },
    { GRP1Ss },
    { "testB",	Eb, Gb, XX },
    { "testS",	Ev, Gv, XX },
--- 492,509 ----
    /* 80 */
    { GRP1b },
    { GRP1S },
!   /* this one is blank in appendix A of the 386 book, and given as
!      "MOVB AL, imm8 in appendix A of the Pentium book with a footnote
!      saying "Reserved"; it *should* be "Immediate Grp1, Ev, Ib"
!      according to an Intel person who says it'll be fixed in the -004
!      version of the Pentium book.
! 
!      The trick here is that 0x80 sets neither the "s" nor the "w" bit,
!      while 0x82 sets the "s" bit but not the "w" bit.  However, if the
!      "w" bit isn't set, the setting of the "s" bit is irrelevant, as
!      the operands are one byte long, so there's no sign-extension to be
!      done. */
!   { GRP1b  },
    { GRP1Ss },
    { "testB",	Eb, Gb, XX },
    { "testS",	Ev, Gv, XX },
*************** static const struct dis386 dis386_twobyt
*** 968,974 ****
    { "(bad)", XX, XX, XX },
    { "(bad)", XX, XX, XX },
    /* 20 */
!   /* these are all backward in appendix A of the intel book */
    { "movL", Rd, Cd, XX },
    { "movL", Rd, Dd, XX },
    { "movL", Cd, Rd, XX },
--- 975,982 ----
    { "(bad)", XX, XX, XX },
    { "(bad)", XX, XX, XX },
    /* 20 */
!   /* these are all backward in appendix A of the intel book,
!      but correct in appendix A of the Pentium book.  */
    { "movL", Rd, Cd, XX },
    { "movL", Rd, Dd, XX },
    { "movL", Cd, Rd, XX },

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFA]: opcodes / i386 disassembler
  2000-07-20 18:41 [RFA]: opcodes / i386 disassembler Michael Snyder
@ 2000-07-20 18:59 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2000-07-20 18:59 UTC (permalink / raw)
  To: Michael Snyder; +Cc: binutils, gdb-patches

On Thu, 20 Jul 2000, Michael Snyder wrote:

> Would the following be acceptable?  Assuming I provided an
> suitable ChangeLog entry?

Yes.  Please check it in.  The x86 instruction set has many of these cases
where there's more than one encoding of an instruction.  Some people even
used this feature to store covert messages in code - eg. to brand code as
being produced by a certain assembler.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-07-20 18:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-20 18:41 [RFA]: opcodes / i386 disassembler Michael Snyder
2000-07-20 18:59 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).