Important: The information in this document is obsolete and should not be used for new development.
32-Bit Everything
The 32-bit everything method allows you to remove limitations on segment size, global data size, and jump-table size by using compiler and linker-model far
options instead of the default value, which is-model near
. For each compilation unit, the compiler allows you to choose
You can link any combination of near and far model compiled modules, but if any of the modules are compiled with the
- full 32-bit offsets for global data by specifying the
-model farData
option- full 32-bit offsets for code references by specifying the
-model farCode
option- full 32-bit offsets for data and code by specifying the
-model far
option
-model far
,-model farData
, or-model farCode
options, you must specify the-model far
linker option.
In assembly language, the use of a 32-bit reference for the target address of an instruction must be explicitly demanded by use of the absolute long address syntax (expr).
- WARNING
- Because the 32-bit everything solution is implemented by modifications to the
LoadSeg
,UnloadSeg
,Launch
,Chain
, andExitToShell
traps, it will not work if your application patches these traps without calling the original traps when your patch completes. If you need to use_LoadSeg
or_UnloadSeg
in the 32-bit everything environment, you must use the routines in theRTLib.o
library. For details, see Appendix B.L
, where expr is a relocatable expression. Two other requirements must be met:
Global data references, references to code in the same segment, and references to code in a different segment all cause the assembler to produce similar records that tell the linker that a 32-bit patch is needed. The linker determines whether the references are to code or data. If the reference is to code, the linker can also determine whether the reference is internal or external.
- The relevant operand symbol must be imported. This means that the defining occurrence of the symbol must be in a different module than the module or modules containing its use as a 32-bit reference.
- The option
-model far
must be used for the assembly. Since the absolute long address syntax specifies absolute operands by definition, the use of this form with a relocatable symbol is an error unless you specify the-model far
option.
The example shown in Listing 10-1 illustrates using 32-bit references for the target address of an instruction.
Listing 10-1 Using 32-bit references for the target address of an instruction
MAIN IMPORT STUFF ; Symbols from other IMPORT THERE ; modules must be IMPORT ELSEWHERE ; imported. JSR (THERE).L ; Symbols are written using JSR (ELSEWHERE).L ; (xxx).L syntax. ADD.W (STUFF).L,DO ENDMAIN PROC ; Note that THERE is in the MAIN EXPORT THERE ; segment THERE NOP ENDPROC SEG 'SG1 ' ; Note that ELSEWHERE PROC ; is in a different segment EXPORT ELSEWHERE ELSEWHERE NOP ENDPROC PROC DATA EXPORT STUFF STUFF DS 1 ENDPROC END