CompuServe Thread

Forum unknown · Software

Lattice C

3 messages in this thread
#4377From: Russ WetmoreJan 5, 1986 10:44 PM
You're correct regarding the semantics. I'm using the term "relocatable" to mean PC-relative, as in "this code can be relocated to anywhere in memory, even after loading, and operate without changes." PC-relative code is faster (slightly, but faster) than its absolute long equivalent, and requires 1/3 less code space. You can't MOVE PC-relative – this one limitation is generally handled by assigning an address register or two to the base(s) of global variables and indexing indirect off it/them. Again, address register indirect is faster, and less memory consumptive, than direct absolute addressing. Most of my experience writing 68000 code comes from the Mac. It _requires_ "non-absolute" (okay?) addressing because of its heap management. Code segments are treated no differently from other data in memory, and the system frequently shuffles segments around in the heap during compaction/garbage collection. Mac development environments (like assemblers) "help" you out by generating PC-relative code in response to "normal" language directives. Thus, you can write non-absolute programs without the extra syntax bogging you down. Since non-absolute code requires no load-time modification, is faster, and is less memory consumptive than absolutely located code, it seems almost ludicrous to not to support it (even mandate it) as the default addressing mode. [ Russ ] [ "Soapboxes'R'Us" ]
#4439From: Jack CrenshawJan 6, 1986 8:07 PM
OK, Russ, that explains a lot. Having come from the CP/M world (plus Multics, Unix and VMS), I was not aware that the mac required PC relative code. I hear you when you say PC-relative code is fast and small. I still say that it's a dumb restriction to place on a user … most computer systems let the programmer use _ALL_ the instructions on the chip. I thought it was dumb when I heard Amiga had made that restriction, and I still think it's dumb now that I've heard Apple did it.
#4439From: Jack CrenshawJan 6, 1986 8:07 PM
OK, Russ, that explains a lot. Having come from the CP/M world (plus Multics, Unix and VMS), I was not aware that the mac required PC relative code. I hear you when you say PC-relative code is fast and small. I still say that it's a dumb restriction to place on a user … most computer systems let the programmer use _ALL_ the instructions on the chip. I thought it was dumb when I heard Amiga had made that restriction, and I still think it's dumb now that I've heard Apple did it.