MZ: Difference between revisions

190 bytes added ,  1 year ago
m
[unchecked revision][unchecked revision]
m (grammar)
Line 195:
 
Using the ia16-gcc toolchain, it is possible to generate 32-bit code with a compiler or assembler and convert it to an MZ (it will ''not'' run on DOS). The IA16 linker can be invoked with the argument `-m i386msdos` to generate an EXE. Static libraries can be importing by replacing unresolved symbols with those from another file that defines them as ordinals. This can be done by scanning the relocation table for each address in the program and replacing anything that includes a magic bit indicating that this symbol is to be resolved by the loader. Library imports could be defined in a non-standard structure if needed.
 
The assembly file with the ordinals has do make all symbols relative to the location counter ($ in NASM) so that relocations are generated and the ordinal is not just copied into the code.
 
The disadvantage of this approach is that importing can only be done with ordinals and that the program must fit in 1MB.
Anonymous user