Commit: RL78 gas: Fix encoding of addw/subw instructions

Nick Clifton nickc@redhat.com
Wed Feb 4 12:00:00 GMT 2015


Hi Guys,

  I am checking in the patch below to fix a bug in the encoding of the
  addw and subw instructions for the RL78, when HL-direct addressing was
  used.  The bug was that an extra zero byte was being encoded at the
  end of the instruction.

Cheers
  Nick

gas/ChangeLog
2015-02-04  Nick Clifton  <nickc@redhat.com>

	* config/rl78-parse.y (addsubw): Fix encoding of [HL] variant of
	these instructions.

diff --git a/gas/config/rl78-parse.y b/gas/config/rl78-parse.y
index d1cf71c..a381973 100644
--- a/gas/config/rl78-parse.y
+++ b/gas/config/rl78-parse.y
@@ -259,7 +259,7 @@ statement :
 	  { B2 (0x61, 0x09|$1); O1 ($8); }
 
 	| addsubw AX ',' opt_es '[' HL ']'
-	  { B4 (0x61, 0x09|$1, 0, 0); }
+	  { B3 (0x61, 0x09|$1, 0); }
 
 	| addsubw SP ',' '#' EXPR
 	  { B1 ($1 ? 0x20 : 0x10); O1 ($5);



More information about the Binutils mailing list