This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: arm thumb2 ldr.w syntax?


On Wed, Sep 14, 2011 at 5:28 PM, Roland McGrath <mcgrathr@google.com> wrote:
> The disassembler shows me this for a Thumb2 instruction of interest:
>
> ?28: ? f8dc c000 ? ? ? ldr.w ? ip, [ip]
>
> But I cannot figure out how to make the assembler emit that.
I've run across similar when trying to generate Thumb instructions on
an ARM. In my case, I could not get ADDS generated (the instruction
was being rejected as invalid). Instead of 'ADDS, r1, r1, r0', I
needed to emit the instruction manually:

__asm__
(
  "ldr  r0, %[xa]   ;"  // R0 = a
  "ldr  r1, %[xb]   ;"  // R1 = b
  ".short 0x1809    ;"  // 'adds r1, r1, r0'
  ...
);

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]