Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Help decoding a vax instruction



On Wed, 21 Aug 2019, coypu%sdf.org@localhost wrote:

> > I'm a vax newbie. What does this one do?
> > 
> >    c:	98 40 a0 02 	cvtbl 0x2(r0)[r0],15 <e+0x15>
> 
> Managed to find
> https://www.cs.auckland.ac.nz/references/macvax/indexed-address-mode.html
> which seems to say
> convert byte to long
> src = 0x2 + r0 + [r0 * operand size]
> dest = 0x15
> 
> The 0x15 amount makes more sense if I consider it's gcc -c output, so
> it's going to be a real address after linking probably (?).

 There's probably a relocation attached to the operand; use `objdump -dr' 
to see the relocation.  The dump above has the bytes of the second operand 
removed, however the whole instruction could possibly look like:

   c:	98 40 a0 02 	cvtbl 0x2(r0)[r0],15 <e+0x15>
  10:	ef 00 00 00
  14:	00
			11: R_VAX_PC32	foo+0x15

where `15' (hexadecimal) is merely an addend to the symbol `foo', which as 
you correctly expect will be resolved and the final value of the operand 
calculated and pasted into the operand by the linker.

 HTH,

  Maciej


Home | Main Index | Thread Index | Old Index