Re: Alpha assembly language - ldah/lda after jsr

"Glen Herrmannsfeldt" <gah@ugcs.caltech.edu>
13 Oct 2003 15:28:09 -0400

          From comp.compilers

Related articles
Alpha assembly language - ldah/lda after jsr tim.jones@mail.com (2003-10-08)
Re: Alpha assembly language - ldah/lda after jsr gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2003-10-12)
Re: Alpha assembly language - ldah/lda after jsr jvorbrueggen@mediasec.de (Jan C.=?iso-8859-1?Q?Vorbr=FCggen?=) (2003-10-12)
Re: Alpha assembly language - ldah/lda after jsr firefly@diku.dk (Peter \Firefly\Lund) (2003-10-12)
Re: Alpha assembly language - ldah/lda after jsr gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2003-10-13)
Re: Alpha assembly language - ldah/lda after jsr gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2003-10-13)
| List of all articles for this month |

From: "Glen Herrmannsfeldt" <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: 13 Oct 2003 15:28:09 -0400
Organization: Comcast Online
References: 03-10-040
Keywords: assembler, architecture
Posted-Date: 13 Oct 2003 15:28:09 EDT

"Timothy Jones" <tim.jones@mail.com> wrote in message


> I have a problem with some alpha assembly code. Specifically with the
> ldah/lda pair of instructions to load the $gp after a function call.
> Initially the alpha compiler produces this:


> jsr $26, ($27), spec_getc!lituse_jsr!468
> ldl $1, ($12)
> ldah $gp, ($26)!gpdisp!469


I don't think I understand the disassembly at all. In the book I have, !
is used as a comment delimiter. ldah is described as:


      LDAH Ra.wq,disp.ab(Rb.ab)


      The virtual address is computed by adding register Rb to 65536 times the
      sign extended 16 bit displacement. The 64 bit result is written to Ra.
      With no displacement, it would seem to copy Rb into Ra.


So, in the example there is no displacement for either ldl or ldah.


In any case, reassembling the output of disassemblers is never easy. Most
disassemblers only output constant displacements, offsets, and other types
of addressing information that they find in the instructions. Assembler
input is normally symbolic labels that the assembler can use to determine
such addresses. To be able to reassemble the output, one must go through
and replace all the constants with symbolic names, with the appropriate
definition for the symbolic names.


-- glen


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.