🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #6020

Re: Manx 3.6 intermediates are _wierd_

#6020
From: Matthew Dillon
Date: Tue, 23 Oct 1990 04:39
47 lines
2166 bytes
In article <2354@trlluna.trl.oz> aduncan@rhea.trl.oz (Allan Duncan) writes:
>While I was doing some debugging I was perusing the assembler listings,
>and since I wanted to be sure what addressing mode was actaully being
>used, looked at the binary opcodes.  Did I get a surprise!
>
>As we all know, Manx have a near data model that uses the a4 register as
>a base and adds a signed 16 bit offset to get the data address, so I
>would have expected to see
>	2c6c xxxx	(move.l xxxx(a4),a6)
>
>but found instead
>	2c6d xxxx	(move.l xxxx(a5),a6) !!
>
>Just in case there was a bug in the assembler listing I checked the .o
>files, and sure enough, there was 2c6d.
>But after linking these self same .o files, the final object file
>contains 2c6c as it should.
>Curiously, subroutines with local variables contain move.l d(a5),an in
>both the .o files and the final object.
>
>How on earth does the linker know which d(a5) should be converted to
>d(a4), and why do it this way in the first place?
>
>Allan Duncan	ACSnet	a.duncan@trl.oz
>(03) 541 6708  ARPA    a.duncan%trl.oz.au@uunet.uu.net
>		UUCP	{uunet,hplabs,ukc}!munnari!trl.oz!a.duncan
>Telecom Research Labs, PO Box 249, Clayton, Victoria, 3168, Australia.


    Uh, no.  MANX uses A4 for near-data globals and static, just like
    lattice.. well, close enough anyway.

    A5 is used when referencing AUTOs (i.e. stack variables).  You will
    note that the routines in question have a LINK and UNLK instruction
    at their beginning and end.  A5 is used to reference stack items to
    allow the compiler to push and pop arguments to functions without
    having to keep track of the stack pointer.

					-Matt

--


    Matthew Dillon	    dillon@Overload.Berkeley.CA.US
    891 Regal Rd.	    uunet.uu.net!overload!dillon
    Berkeley, Ca. 94708
    USA
Technical Details
Message-ID: <dillon.6722@overload.Berkeley.CA.US>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!overload!dillon
References: <2354@trlluna.trl.oz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!overload!dillon
From: dillon@overload.Berkeley.CA.US (Matthew Dillon)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Manx 3.6 intermediates are _wierd_
Message-ID: <dillon.6722@overload.Berkeley.CA.US>
Date: 23 Oct 90 04:39:48 GMT
References: <2354@trlluna.trl.oz>
Lines: 47