Address Binding and Relocation
To solve the problem, we need to set up some kind of correspondence between “program addresses” and “real addresses”. This can be done:
• at compile time:
– requires knowledge of absolute addresses; e.g. DOS .com files.
• at load time:
– when program loaded, work out position in memory and update every relevant instruction in code with correct addresses.
– must be done every time program is loaded
– ok for embedded systems / boot-loaders
• at run-time:
– get some hardware to automatically translate between program addresses and real addresses.
– no changes at all required to program itself.
– most popular and flexible scheme, providing we have the requisite hardware, viz. a memory management unit or MMU.