Relative mode of addressing is most relevant to writing:
View worked solution
Answer: B
The correct option is B.
Explanation:
In relative addressing mode (specifically Program Counter relative addressing), the effective address of an operand or target instruction is computed as:
Because all memory references are specified as offsets relative to the current instruction pointer (PC) rather than absolute physical addresses, the entire block of code can be loaded and executed at any arbitrary location in memory without requiring any modification or address translation by a loader. This characteristic is the defining feature of Position-Independent Code (PIC).
Analysis of other options:
- Co-routines (A): These are non-preemptive subroutines that support multiple entry points and suspend/resume states. They rely on stack pointer manipulation and state-saving mechanisms rather than relative addressing.
- Shareable code (C): Also known as reentrant code, this requires a strict separation of code (read-only) and data (writable). While shareable code often benefits from being position-independent, relative addressing is not its primary defining requirement.
- Interrupt Handlers (D): These routines are typically mapped to fixed memory locations specified in an Interrupt Vector Table (IVT), which generally uses absolute or indirect addressing.
Free practice · Your answers on this page are not saved.
