Home >Operation and Maintenance >Windows Operation and Maintenance >What does address relocation mean?
Recommended tutorial: windows operation and maintenance
Introduction
The collection of memory addresses is called memory space or physical address space. In the memory, each storage unit corresponds to the corresponding memory address number. Obviously, the memory space is one-dimensional and linear.
How to transform several virtual one-dimensional linear spaces or multi-dimensional linear spaces into the only one-dimensional physical linear space in memory? This involves two issues: one is the division of virtual space, and the other is the issue of loading the linked and divided content in the virtual space into memory and mapping the virtual address to a memory address, which is called address relocation. or address mapping.
Address relocation is divided into two types: static address relocation and dynamic address relocation.
Static positioning
Static address relocation is the address mapping work completed by the assembly program before the virtual space program is executed. For instructions and data in the virtual space, static address relocation only completes a continuous address transformation with a different first address. It requires that all programs to be executed must complete the links between them before the program is executed, otherwise the correct memory address and memory space will not be obtained.
The advantage of static address relocation is that it does not require hardware support, but the disadvantage is that it must occupy continuous memory space, which makes it difficult to share data and programs.
Dynamic positioning
Dynamic address relocation is a program that will be accessed before the CPU accesses the memory during execution. Or convert data address to memory address. Dynamic address relocation requires hardware support.
The address relocation mechanism requires one or more base address registers BR and one or more program virtual address registers VR. The calculation relationship between the memory address MA of the instruction or data and the virtual address is as follows: MA=(BR) (VR), here (BR), (VR) respectively represent the contents of the register.
The advantages of dynamic relocation are: memory can be allocated discontinuously, providing a basis for implementing virtual memory, and facilitating program sharing.
The above is the detailed content of What does address relocation mean?. For more information, please follow other related articles on the PHP Chinese website!