Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!ncar!noao!mcdsun!fishpond!fnf From: fnf@fishpond.UUCP (Fred Fish) Newsgroups: comp.sys.amiga.tech Subject: Re: Another question on the 80286- er, 68000 memory models Message-ID: <47@fishpond.UUCP> Date: 10 Jun 88 01:19:47 GMT References: <8805182223.AA20918@cory.Berkeley.EDU> <2653@louie.udel.EDU> <2869@polya.STANFORD.EDU> <2069@sugar.UUCP> <527@sas.UUCP> Reply-To: fnf@fishpond.UUCP (Fred Fish) Organization: occasionally Lines: 26 In article <527@sas.UUCP> toebes@sas.UUCP (John Toebes) writes: > Because of the C language definition (and even Modula2) >you do not have any idea of the total amount of data that a program might >contain. Given this, the code must be generated knowing AHEAD of time >how big the data is going to be. The ONLY real optimization that can be >done to do this without the programmer giving information ahead of time is >to delay generation of code until link time. There are indeed articles >discussing this type of optimization, but it is far from acceptable in >performance for a simple piece of information. As a side note to this discussion, since it's not really relevant to the Amiga (yet :-), the M88000 linker solves the small/large model problem by actually patching the object code as necessary. If a particular data item is in the lower 64K of memory, or within 64K of any known base pointer, the load or store access can be done with a single instruction (small model equivalent). If not, then the access can be done with either a two or three instruction sequence (large model equivalent), which the linker synthesizes and uses to replace the original instruction. The actual code to do this is only a few pages of C code, and took me about two days to write and debug. -Fred -- # Fred Fish hao!noao!mcdsun!fishpond!fnf (602) 921-1113 # Ye Olde Fishpond, 1346 West 10th Place, Tempe, AZ 85281 USA