πŸŽ“ BookMCQ
← Back to 3. Simple as Possible (SAP) - II

πŸ“ Addressing Modes of SAP II Computers (12 MCQs)

Four Methods of Specifying Instruction Operands

SAP-II supports direct, immediate, register and implied addressing modes. These modes determine how an instruction identifies the data required for an operation. An operand may be stored at a specified memory address, supplied as part of the instruction, held in a processor register or understood from the instruction mnemonic itself. Correct addressing interpretation determines how the processor obtains its required information.

Direct Addressing Through a Specified Memory Location

In direct addressing, the instruction contains the explicit address of the memory location holding the operand. The processor extracts the address and transfers it to the memory address register before accessing the selected location. Because SAP-II uses a 16-bit address, a direct memory address can identify locations throughout its 64 KB address space.

Immediate and Register Addressing Mechanisms

Immediate addressing places the required data byte directly after the opcode, so no separate operand-memory lookup is needed beyond fetching the instruction bytes. Register addressing identifies a processor register containing the operand. The controller selects the relevant register output and transfers its contents to the destination or arithmetic unit without accessing an additional memory location.

Identifying Operands in Four Addressing Examples

In LDA 2000H, direct addressing selects memory location 2000H. In MVI A, 25H, immediate addressing loads 25H into the accumulator. MOV A,B uses register addressing to copy B into A. CMA uses implied addressing because the accumulator is understood from the instruction itself.

Addressing Modes and Memory-Access Efficiency

Addressing modes influence instruction length, operand location and the number of memory accesses required during execution. Direct addressing provides access to specific memory locations, while immediate addressing is convenient for constants. Register addressing supports faster internal data movement, and implied addressing provides compact instructions when the operand is predetermined by the operation.

Misconceptions About Operand Addressing

'Immediate addressing means the processor accesses the address following the opcode' is incorrect because that byte represents the actual operand value. 'MOV A,B reads a memory location named B' is incorrect because B is a register. 'CMA requires an explicit memory address' overlooks its implied accumulator operand.

Addressing-Mode Identification and Operand Tracing

Practise classifying instructions as direct, immediate, register or implied. Identify whether an operand is a memory address, an immediate value or register contents. Questions may ask for instruction-byte interpretation, memory-access requirements or differences between instruction formats. Pay particular attention to LDA, STA, MVI, MOV, ADD and CMA examples.

Operand Location and Addressing Terminology

  • Direct Addressing - Operand is stored at a specified address.
  • Immediate Addressing - Operand value follows the opcode.
  • Register Addressing - Operand resides in a CPU register.
  • Implied Addressing - Operand is specified by the mnemonic.
  • Operand - Data processed by an instruction.
  • Memory Address - Identifies a particular memory location.
2
Easy
5
Medium
5
Hard

πŸ“ All Addressing Modes of SAP II Computers MCQs

Q1. What is the word size of the Intel 4004 microprocessor?

A.4-bit βœ…
B.8-bit
C.16-bit
D.32-bit
πŸ’‘ Difficulty: easy | βœ… Correct: A

πŸ“– Explanation: The Intel 4004, introduced in 1971, processes data in groups of four bits, so its word size is 4‑bit. This determines the width of its data bus and the size of registers it can handle. Options B, C, and D describe larger word sizes that belong to later microprocessors such as the 8085 (8‑bit) or 80286 (16‑bit). Therefore the correct answer is A.

Q2. Why does a CPU use different addressing modes?

A.To increase clock speed
B.To provide flexibility in locating operands βœ…
C.To reduce power consumption
D.To simplify hardware design
πŸ’‘ Difficulty: easy | βœ… Correct: B

πŸ“– Explanation: Different addressing modes give the processor flexibility in finding the required operand, whether it is stored in a register, in memory, or as an immediate constant. This flexibility allows programs to be written more efficiently and enables the CPU to handle a variety of data layouts. Options A, C, and D describe unrelated benefits; they do not explain the primary purpose of multiple addressing modes. Hence B is correct.

Q3. A programmer needs to load the constant value 25 into accumulator A. Which instruction correctly uses immediate addressing?

A.MOV A,25 βœ…
B.LD A,[25]
C.MOV A,#25
D.ADD A,25
πŸ’‘ Difficulty: medium | βœ… Correct: A

πŸ“– Explanation: Immediate addressing embeds the constant directly in the instruction, usually indicated by a prefix such as β€œ#”. The form β€œMOV A,#25” places the value 25 into A without referencing memory. Option A treats 25 as a memory address, option B uses indexed syntax, and option D performs an addition rather than a load. Thus the correct choice is C, which matches the definition of immediate addressing.

Q4. Memory location 0x2000 contains the address 0x3000 where the desired byte resides. Which instruction accesses the byte using indirect addressing?

A.MOV A,0x2000
B.MOV A,[0x2000]
C.MOV A,@0x2000
D.MOV A,(0x2000) βœ…
πŸ’‘ Difficulty: medium | βœ… Correct: D

πŸ“– Explanation: Indirect addressing means the operand’s address is stored in memory, and the instruction must dereference that address to reach the actual data. The syntax β€œ(0x2000)” indicates that the processor should first read the contents of 0x2000 (which is 0x3000) and then fetch the byte at that address. Options A and B access the value directly, while C uses a different indirect notation that is not standard for this context. Therefore D is correct.

Q5. Which statement best describes register addressing?

A.It accesses an operand that resides inside a CPU register
B.It uses a memory address to fetch the operand βœ…
C.It can only be used with immediate values
D.It requires an index register to calculate the address
πŸ’‘ Difficulty: medium | βœ… Correct: B

πŸ“– Explanation: Register addressing refers to operations where the operand is located in a CPU register, allowing the CPU to work on data without any memory fetch. This reduces access time compared with memory‑based modes. Option B describes direct addressing, option C mixes concepts incorrectly, and option D describes indexed addressing. Consequently, A correctly captures the essence of register addressing.

Q6. Register X holds the base address 0x1000. An instruction uses indexed addressing with an offset of 0x20. What effective address is generated?

A.4128 βœ…
B.4096
C.32
D.4640
πŸ’‘ Difficulty: medium | βœ… Correct: A

πŸ“– Explanation: Indexed addressing adds an offset to the contents of a base register to form the effective address. Adding 0x20 to the base value 0x1000 yields 0x1020. Options B and C ignore the offset, while D adds the offset twice, producing an incorrect result. Therefore the correct effective address is 0x1020, making A the right choice.

Q7. What is the main advantage of relative addressing for modern software development?

A.It allows larger address spaces
B.It enables faster execution of loops
C.It supports position‑independent code βœ…
D.It reduces the total instruction count
πŸ’‘ Difficulty: medium | βœ… Correct: C

πŸ“– Explanation: Relative addressing expresses the target address as a displacement from the current program counter, which makes code relocatable without needing absolute addresses. This is essential for position‑independent executables and shared libraries. Options A and B describe unrelated benefits, and D is not a guaranteed outcome. Hence C correctly identifies the primary advantage.

Q8. An array of five 8‑bit integers starts at address 0x4000. Which instruction sequence correctly computes the sum using indexed addressing?

A.LD R0,0x4000; ADD R0,R0; ...
B.LD R0,0x4000; LOOP: ADD R1,R0; INC R0; DEC COUNT; JNZ LOOP
C.LD R0,0x4000; LOOP: ADD ACC,R0; ADD R0,1; DEC N; JNZ LOOP
D.LD R0,0x4000; MOV R1,0; LOOP: ADD R1,[R0]; INC R0; DEC COUNT; JNZ LOOP; MOV ACC,R1 βœ…
πŸ’‘ Difficulty: hard | βœ… Correct: D

πŸ“– Explanation: Option D uses indexed addressing β€œ[R0]” to fetch each array element, increments the base register to step through the memory, and accumulates the result in R1 before moving it to the accumulator. The other options either omit indexed addressing, misuse registers, or lack a proper loop structure. By correctly applying indexed addressing, the sequence efficiently sums the array, so D is the right answer.

Q9. How does immediate addressing compare with direct addressing regarding memory access?

A.Immediate produces a longer instruction
B.Immediate reduces memory accesses βœ…
C.Direct allows larger constant values
D.Direct is always faster than immediate
πŸ’‘ Difficulty: hard | βœ… Correct: B

πŸ“– Explanation: Immediate addressing embeds the constant within the instruction itself, so the CPU does not need to perform a separate memory read to obtain the operand. Direct addressing, by contrast, requires the CPU to fetch the operand from a specified memory location, incurring an extra memory cycle. Options A and C misstate the effect on instruction length and constant size, while D incorrectly claims a universal speed advantage. Therefore B accurately describes the memory‑access difference.

Q10. Given a variable stored in a CPU register, a value in cache, a datum in main memory, and another in external RAM, which addressing mode will retrieve the data fastest?

A.Register addressing βœ…
B.Direct addressing
C.Indirect addressing
D.Relative addressing
πŸ’‘ Difficulty: hard | βœ… Correct: A

πŸ“– Explanation: Data already located in a register can be accessed without any memory lookup, making register addressing the quickest method. Cache, main memory, and external RAM all require progressively longer access times, and the addressing mode used to reach them cannot bypass those delays. Options B, C, and D involve memory references that are slower than a register fetch. Consequently, the fastest access is achieved with register addressing, choice A.

Q11. What role does the control unit play when the CPU selects an addressing mode for an instruction?

A.It performs arithmetic operations
B.It stores program data
C.It generates the system clock
D.It decodes the instruction to determine the addressing mode βœ…
πŸ’‘ Difficulty: hard | βœ… Correct: D

πŸ“– Explanation: The control unit interprets each fetched instruction, extracts the opcode, and determines which addressing mode is required for the operand. Based on this decoding, it orchestrates the necessary datapath signals to fetch the operand correctly. Options A and B describe the ALU and registers, while C pertains to timing circuitry, none of which directly handle addressing‑mode selection. Thus D correctly identifies the control unit’s function.

Q12. A program crashes because it uses direct addressing instead of indexed when processing a table of records. Which step should the programmer take to fix the error?

A.Change the instruction to use indexed addressing βœ…
B.Increase the size of the memory region
C.Insert a NOP instruction before the problematic line
D.Recompile the program with higher optimization level
πŸ’‘ Difficulty: hard | βœ… Correct: A

πŸ“– Explanation: The crash occurs because direct addressing references a fixed address that does not correctly step through the table, whereas indexed addressing adds an offset to a base register for each record. Modifying the instruction to use indexed addressing resolves the logic error. Options B, C, and D do not address the root cause of the addressing mistake. Therefore the appropriate corrective action is A.

πŸ”— Related Topics (MCQs)