Lattice C
01-Jan-86 08:03:35
Sb: #3466-Lattice C
Fm: Jack Crenshaw 72325,1327
To: Dave Haynie/C128 Land 76703,2047
This message turned up in search, but its forum couldn’t be identified from the original transcript, so it may not be linked into its thread.
Dave, I've heard this comment before, that you can't do absolute code on the
Amiga. I don't claim to be an expert on the AMiga … I didn't get a
developer's kit, so don't have all the facts, but I simply can't believe it's
true.
I realize that the Amiga uses "scatter-loading", so that a program ends up
spread out all over memory, but my understanding is that that's taken care of
by the loader. The linker doesn't generate a true absolute file .. just one
that has had all external references resolved. The relocation info is still
intact, so when the loader breaks the program up into hunks for loading, it can
relocate each hunk differently, and chain them together. Isn't that the same
way it's done on the Big Blue PC?
Anyhow, I get the idea that some folks have read all this and concluded that
you must write all your code for the Amiga using only PC-relative addressing. I
don't see any restriction like that in the documentation, and I think that's a
concept that needs to be put to rest. I don't think that's really what you
meant by your comment, but I just wanted to clear the air.
Getting back to Small C, your point's well taken. Although in reality the code
doesn't have to be compatible with the linker, just the loader, in practical
terms it's the same thing, since the formats are the same. It would take major
surgery to a compiler to get it to produce a relocatable output when it wants
to generate absolute. So as you said, the only practical thing to do is to have
it produce assembler language source. But then, if you have to have separate
phases for compile, assemble, and link, we're back to slow performance. Sigh.
Jack