This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: GNURX toolchain generates incorrect opcode for "mov.b #0xff, [r0]" instruction.
- From: Nick Clifton <nickc at redhat dot com>
- To: "Vinay Kumar. G" <Vinay dot G at kpit dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Wed, 3 Feb 2016 14:53:19 +0000
- Subject: Re: GNURX toolchain generates incorrect opcode for "mov.b #0xff, [r0]" instruction.
- Authentication-results: sourceware.org; auth=none
- References: <SIXPR0301MB1020E733A8B7D90F3EE3DEBF93DF0 at SIXPR0301MB1020 dot apcprd03 dot prod dot outlook dot com>
Hi Vinay,
+ | MOV DOT_B '#' EXPR ',' '[' REG ']'
+ { B2 (0xf8, 0x04); IMMB ($4, 12);}
However I am still facing issue with registers other than r0 like r1-r15. Can you please give
some hints how to go about with this.
As DJ explained, you need an extra instruction inside these patterns in order to insert the register value. IE:
| MOV DOT_B '#' EXPR ',' '[' REG ']'
{ B2 (0xf8, 0x04); F ($7, 9, 3); IMMB ($4, 12);}
| MOV DOT_W '#' EXPR ',' '[' REG ']'
{ B2 (0xf8, 0x01); F ($7, 9, 3); IMMW ($4, 12);}
| MOV DOT_L '#' EXPR ',' '[' REG ']'
{ B2 (0xf8, 0x02); F ($7, 9, 3); IMM ($4, 12);}
Cheers
Nick