Forum unknown
· Software
Lattice C
5 messages in this thread
You can't do absolute code on the Amiga without a potential crash, and
the possibility of automatically obseleting your code. However, if Small-C
were to produce source code for the Amiga Assembler, then all that linking
should be independent of the compiler. And with enough Small-C libraries, much
of the lattice stuff could be re-created to run under Small-C.
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
Jack,
You *do* have to generate relocatable code for the
Amiga – Msrs. Big Blue and company don't multitask – this is
the real reason the programs on the Amiga have to be relocatable.
You can't depend on your program to load into the same area of memory
each time, since a user may have placed another program (or another
activation of your program) there earlier.
Fortunately, the 68000 makes this easy.
Best,
SDB
Jack,
You *do* have to generate relocatable code for the
Amiga – Msrs. Big Blue and company don't multitask – this is
the real reason the programs on the Amiga have to be relocatable.
You can't depend on your program to load into the same area of memory
each time, since a user may have placed another program (or another
activation of your program) there earlier.
Fortunately, the 68000 makes this easy.
Best,
SDB
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