Subject: Re: m68k Asm and C
To: None <hotz@jpl.nasa.gov>
From: Ken Nakata <knakata@itpjp.co.jp>
List: port-mac68k
Date: 06/24/1999 10:30:38
On Wed, 23 Jun 1999 18:22:36 -0700, "Henry B. Hotz" <hotz@jpl.nasa.gov> wrote:
> At 6:14 PM -0700 6/20/99, Andy Finnell wrote:
> >It is also important to note that you can't remove the # in front of an
> >integer immediate like I said before in another post.  It'll compile,
> >but as I found out its not the same, and you get a seg fault.  I've had
> >to ditch the template for now and explicitly define the syscalls.  It
> >works, but its a little more work for me.
> 
> Sounds like a base conversion issue.  Without the # it probably defaults to
> a different one of {octal, decimal, hex} from what it does with.  If you
> can't figure out what it's doing it should be easy to look at hexdump(1) of
> the object file output of some simple test cases.

Noooooooooooooooooooo!

#number and number are immediate and absolute addressing modes,
respectively.  IOW, "movel #1234,d0" loads 1234 into d0, but "movel
1234,d0" reads a long word from memory address 1234 and loads the
value into d0.  #number and number have different semantics!

Ken