Subject: Computer Organization (344 CSM) Question 1 . Assume that a new machine
ID: 3583704 • Letter: S
Question
Subject: Computer Organization (344 CSM)
Question 1. Assume that a new machine has been developed. This machine has 64 general purpose registers of 64 bits each. This machine has 2GB main memory with memory word size of 32 bits. The instructions of this machine are of one or two memory words. Each instruction should have at most two operand addresses. The machine implements the internal stack on 32 of its registers. List four addressing modes that must be supported by a machine, Give justification of the selection of each of the addressing modes.
Explanation / Answer
The four addressing modes that the machine will support are: Direct, Index, Base Register and Stack.
Direct Addressing
Direct addressing is a very simple addressing mode used. Here, address of the operand is directly embedded into an instruction set. In direct addressing, one of the operand refers to register and memory location and the other operands reference to register.
Justification of usage: Direct addressing mode is mostly used for accessing simple variables especially for global variables but less for local variables.
Index Addressing
Index addressing is a method where the address of the operand is calculated by adding a constant value to the general registers also knows as Index registers.
Justification of usage: Index Addressing mode is mostly used for referencing iterative local variables or accessing array elements.
Base Register Addressing
The Base Register Addressing method is very similar to Index addressing with the exception that here the registers are called Base registers instead of Index registers. The content of a base register is added to the address part of the instruction to obtain the effective address.
Justification of usage: Base Register Addressing is mostly used for identifying memory position of programs especially in case of multiprogramming systems.
Stack Addressing: A Stack is defined as a Linear List of locations where data is inserted and removed with Last-In First-Out (LIFO) approach. Here the operand is place on top of the stack.
Justification of usage: Stack addressing is especially useful for referencing local variables and also for parameter passing.