What are the relocation requirements in segmented addressing?

The relocation requirements of a program are influenced by the addressing structure of the computer system on which it is to execute. Use of the segmented addressing structure reduces the relocation requirements of a program
Consider the following assembly program of 8088. The ASSUME statement declares the Segment registers CS and DS to be available for memory addressing. 



 

Translation time address of A is 0196. At S.NO 16, a reference to A is assembled as a displacement of 196 from the contents of the CS register. This avoids the use of an absolute address. Now no relocation is needed if segment SAMPLE is to be loaded in the memory starting at the address 2000 because CS register would be loaded with the address by a calling program (or by the OS). The effective operand address would be calculated as <CS> + 0196 = 2196. A similar situation for B in S.NO. 17. The reference to B is assembled as a displacement of 0002 from the contents of the DS register. Since the DS register would be loaded with the execution time address of DATA –HERE, the reference to B would be automatically relocated to the correct address.




0 comments:

Feel free to contact the admin for any suggestions and help.