public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch, moxie] Move NOP instruction
@ 2010-02-03 12:50 Anthony Green
  0 siblings, 0 replies; only message in thread
From: Anthony Green @ 2010-02-03 12:50 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]

The following patch moves the moxie NOP instruction from opcode 0x00 to
0x0f.  As things stand after this change, all instructions starting in
0x00 and 0xff are illegal instructions.  This should help with
debugging.

I'm checking this change in.  The corresponding GDB simulator change has
already been committed.

AG



[-- Attachment #2: moxie-nop.patch --]
[-- Type: text/x-patch, Size: 1484 bytes --]

2010-02-03  Anthony Green  <green@moxielogic.com>

	* moxie-opc.c (moxie_form1_opc_info): Move "nop" from 0x00 to
	0x0f, and make 0x00 an illegal instruction.


Index: moxie-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/moxie-opc.c,v
retrieving revision 1.3
diff -u -r1.3 moxie-opc.c
--- moxie-opc.c	11 Jun 2009 11:27:58 -0000	1.3
+++ moxie-opc.c	3 Feb 2010 12:41:15 -0000
@@ -50,9 +50,12 @@
    oooo         - form 3 opcode number
    vvvvvvvvvv   - 10-bit immediate value.  */
 
+/* Note that currently two opcodes are reserved as bad, so that all
+   instructions starting with 0x00 and 0xff fault.  */
+
 const moxie_opc_info_t moxie_form1_opc_info[64] =
   {
-    { 0x00, MOXIE_F1_NARG, "nop" },
+    { 0x00, MOXIE_F1_NARG, "bad" },  // Reserved as bad.
     { 0x01, MOXIE_F1_A4,   "ldi.l" },
     { 0x02, MOXIE_F1_AB,   "mov" },
     { 0x03, MOXIE_F1_M,    "jsra" },
@@ -67,7 +70,7 @@
     { 0x0c, MOXIE_F1_ABi4, "ldo.l" },
     { 0x0d, MOXIE_F1_AiB4, "sto.l" },
     { 0x0e, MOXIE_F1_AB,   "cmp" },
-    { 0x0f, MOXIE_F1_NARG, "bad" },
+    { 0x0f, MOXIE_F1_NARG, "nop" },
     { 0x10, MOXIE_F1_NARG, "bad" },
     { 0x11, MOXIE_F1_NARG, "bad" },
     { 0x12, MOXIE_F1_NARG, "bad" },
@@ -143,7 +146,7 @@
     { 0x0c, MOXIE_F3_NARG, "bad" },
     { 0x0d, MOXIE_F3_NARG, "bad" },
     { 0x0e, MOXIE_F3_NARG, "bad" },
-    { 0x0f, MOXIE_F3_NARG, "bad" }
+    { 0x0f, MOXIE_F3_NARG, "bad" }  // Reserved as bad.
   };
 
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-03 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-03 12:50 [patch, moxie] Move NOP instruction Anthony Green

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).