JUMP MAIN
PMUL: DESP 2
LODL A
JNZE ANOTZ
LOCO 0
JUMP DONE
ANOTZ: LODL B
JNZE BNOTZ
LOCO 0
JUMP DONE
BNOTZ: LOCO 0
Assuming a two-pass approach:
Name Addr
------ ----
PMUL 1
ANOTZ 6
BNOTZ 10
Name Addr
------ ----
PMUL 1
ANOTZ 6
BNOTZ 10
MAIN ?
A ?
B ?
DONE ?
MAIN, A, B, DONE.
11.
Entry Point Offset
----------- ------
PMUL 1
ANOTZ 6
BNOTZ 10
Symbol Offset
------ ------
MAIN 0
A 2
B 6
DONE 5
DONE 9
Offset
------
3
7
2080.
For each entry in the external reference table, the value for the external reference would be calculated by adding the defining module's relocation constant to the individual symbol's offset. The locations in the current module would then be updated with the appropriate value, where the location is calculated by adding the current module's relocation constant to the external reference's offset. Locations 2150, 2157, 2152, 2159, 2154, 2161 would be updated with the values 1024, 1024, 1280, 1280, 1536, 1536, respectively.
These locations contain values that must be adjusted by the value of the relocation constant. Locations 2148, 2151, 2156, 2160 would be updated with the values 2158, 2158, 2168, 2168.
Copyright © 1997,
Ray Ontko
(rayo@ontko.com).
If you're curious about why I copyright, see
Peter Suber's
Why
Copyright Web Documents?.