[Coco] CoCo gcc project
David
dbree at duo-county.com
Tue Nov 4 11:02:00 EST 2003
On Tue, Nov 04, 2003 at 12:26:53AM -0600, Roger Taylor wrote:
> At 05:00 PM 11/3/2003 -0600, you wrote:
>
> >I'm not sure if there would be a need for PIC code for RSDOS. Where
> >would that be needful?
>
> A BASIC program that could load ML programs at the end of the BASIC code,
> so as not to overwrite the BASIC code. It's not a common practice over
> here, but that's one use.
Yes, that would work. Normally in BASIC, though, if you load an ML
file, the load address is fixed, although, of course, you can
offset-load. If you do offset-load, PIC _would_ be necessary.
> >As far as non-PIC code for L2, I realize that it does work for a program
> >that is the only one in the address space, and most programs that would
> >be compiled with a C compiler would normally be pretty large, thus not
> >merged with others, but if you had a non-PIC program and merged it with
> >another, then wouldn't that break, if it wasn't the first program in the
> >group?
>
> I wrote many demo OS-9 L2 programs using RMA and really never used
> position-independent code, because you get the whole 64k address space
> (more/less) to yourself.
Right, if it's the only module in that address space. However, if you
had two modules - dothis and dothat, and then you did "merge dothis
dothat >doboth", then, one of the programs, let's say, dothat, wouldn't
begin at address 0 and absolute addresses then would be wrong.
> PIC has it's uses, but some people insist on this type of slower code for
> everything they do, even for programs that can only run at a certain base
> address/origin.
Right. That's why I think that it might not be necessary to include PIC
addressing mode in RS-DOS programs. I don't think that you'd be using a
C compiler to write short BASIC utilities to be run from a DOS program,
and that anyone capable of utilizing PIC under BASIC would have the
capability of implementing it without using a C compiler, so it just
doesn't make sense to me to add the fat of including it as an option in
the compiler. just my $.02, though.
> Once people get set in their ways, it's impossible to
> change them. :)
That's true. However, I tend to think that non-PIC code in OS9 products
that are for public consumption might be dangerous. If you have a
utility that you use for yourself, and realize what it is, then you
might be OK, but if someone else takes it and merges it with other
modules into a file, then it wouldn't work.
More information about the Coco
mailing list