Important: The information in this document is obsolete and should not be used for new development.
Increasing Global Data Size
To permit your application to use more than 32 KB of global data, you have the following options:
When linking files compiled with the
- Use the
-model farData
option when you compile C files that reference far data. See "Expanding Global Data and the Jump Table" (page 10-19) for additional information.- Implement 32-bit references in assembly language when necessary.
-model farData
option, ILink sorts data modules into near and far groups by default, placing all 16-bit referenced global data as close to A5 as possible and all 32-bit referenced data farther away. Thus, any data with a 16-bit reference is forced to within 32 KB of A5 if possible.If you are using assembly language, you must explicitly code 32-bit references when you want to avoid fixing a data module to within 32 KB of A5. For the MC68000, you could write something like this:
IMPORT LONGDATA:DATA MOVE.L indirect(PC),D0 ; [4/7/9 clocks]offset -> scratch ; register MOVE.x (A5,D0.L),dest ; [ea: 3/6/7 clocks]access var ; (PEA,etc.) ... indirect: DC.L LONGDATA; ; 32-bit offset of dataIn code that is intended to run only on a 68020 microprocessor, you can do this:
MACHINE MC68020 IMPORT LONGDATA:DATA MOVE.x ((LONGDATA).L,A5),dest; move to destination ; (or PEA) ; [ea: 11/15/25 clocks]The 68020 code, while smaller, runs more slowly than the 68000 code shown above if you ignore the possible impact of the temporary register required (11 versus 7 clock cycles best case, 15 versus 13 clocks cache case, and 25 versus 16 clocks worst case). Also note that the operand addressing mode shown in the last instruction uses normal 68000 syntax; it does not, in this instance, represent far model syntax.