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: GAS ARM config/tc-arm.c


Hi Michael,

 X(ldr,   6800, f8500000),                     \
and
tCE(ldr,       4100000, ldr,      2, (RR, ADDR),    ldst, t_ldst),

Can someone provide me with a description of how the numbers 6800, f8500000, and 4100000 are derived?

OK, so the "6800" is the 16-bit LDR(1) instruction. If you look in the ARM Architecture Reference Manual you will see that the LDR(1) instruction must have the top five bits set to 0 1 1 0 1, or in a hex encoding using 16 bits: 0x6800. Hence the "6800".


Now I do not have a 32-bit Thumb ISA specification to hand, but I expect that the principle is exactly the same. ie "f8500000" is the 32-bit encoding of the top N-bits of the LDR(1) instruction.

Similarly the 32-bit ARM LDR instruction must have bits 20 and 26 set which, in hex is 0x04100000. Hence the "4100000" pattern in the other macro you mention.

Cheers
  Nick


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