📝 Instruction Set of SAP-III Computer (5 MCQs)
Expanded Instruction Set and Processing Capabilities
The SAP-III instruction set provides an extended collection of machine instructions for its 8-bit processing architecture. It includes the instructions introduced in SAP-II and additional operations made possible by registers A, B, C, D, E, H and L. These instructions support data movement, arithmetic, logical processing, branching, stack manipulation and input/output operations, providing a programming environment closely related to the Intel 8085.
Instruction Formats, Opcodes and Operand Selection
Instructions are represented by hexadecimal or binary machine codes and use register, immediate, direct or register-indirect addressing. Some instructions contain only an opcode, while others include an additional data byte or 16-bit address. The opcode determines the operation, and the operand identifies the required register, memory location or numerical value.
Classification of Instructions by Operational Purpose
Data transfer instructions include MOV, MVI, LDA and STA. Arithmetic operations include ADD, ADC, SUB and INR, while ANA, ORA and XRA perform logical processing. JMP and conditional branches modify program flow. PUSH, POP, CALL and RET support stack operations, whereas IN and OUT communicate with external input/output ports.
Example Combining Immediate Loading and Register Arithmetic
Consider MVI A, 25H followed by MVI B, 15H and ADD B. The first instruction loads 25H into the accumulator, the second places 15H in B, and ADD B produces 3AH in A. This sequence demonstrates two-byte immediate instructions followed by a one-byte register-based arithmetic instruction.
Instruction Set Relationship with Processor Hardware
Each instruction corresponds to operations performed by the processor's registers, ALU, memory interface and control circuitry. Register instructions use internal data paths, while memory-reference instructions require address generation and memory access. Branching instructions modify the PC, and stack instructions use SP to access reserved memory. This organization connects assembly-language programming with actual processor hardware.
Misconceptions About SAP-III Machine Instructions
'Every instruction occupies three bytes' is incorrect because instructions may occupy one, two or three bytes. 'MOV A,B destroys the original contents of B' is incorrect because MOV copies data without changing its source. 'ADD B uses B as the result register' is incorrect because the accumulator receives the sum.
Opcode, Instruction-Length and Execution Questions
Practise classifying instructions by function and addressing mode. Identify hexadecimal opcodes, operand formats and instruction lengths. Trace register changes after arithmetic and logical operations, and determine the conditions governing conditional branches. Questions may also require distinguishing direct memory access from register-indirect access or identifying the instructions used for stack and input/output operations.
Machine Instruction and Opcode Terminology
- Opcode - Identifies the required processor operation.
- Operand - Supplies data or its location.
- Mnemonic - Symbolic name of an instruction.
- Machine Code - Binary instruction representation.
- Instruction Length - Number of bytes occupied.
- Addressing Mode - Specifies how operands are obtained.
📝 All Instruction Set of SAP-III Computer MCQs
Q1. A program must copy the value stored at memory address 0x3A into the accumulator. Which SAP-III instruction performs this operation?
📖 Explanation: The LDA (Load Accumulator) instruction reads a byte from the specified memory location and places it into the accumulator, which is exactly what the question asks. STA writes the accumulator to memory, so it would store rather than load. ADD adds the memory operand to the accumulator, changing its value, and JMP changes program flow. Therefore only option A correctly fulfills the requirement, demonstrating how the SAP‑III load operation works in practice.
Q2. To create a loop that decrements a counter from 5 down to 0, which sequence of SAP-III instructions is correct?
📖 Explanation: Option B first loads the literal value 5 into the accumulator, stores it at a memory location named COUNT, then repeatedly decrements COUNT and jumps back while the zero flag is not set. This correctly implements a down‑counting loop. Option A lacks a memory location to hold the counter, so the DEC would affect only the accumulator and lose the loop state. Options C and D use the wrong arithmetic operation (SUB or ADD) instead of decrementing the counter, so they would not produce the intended countdown.
Q3. In SAP-III, the opcode format uses bits 7‑5 for the operation code and bits 4‑0 for the operand address. Which 8‑bit binary pattern represents the instruction to store the accumulator into memory address 0x12?
📖 Explanation: The STORE (STA) operation in SAP‑III is assigned the three‑bit code 100. The address 0x12 equals binary 10010, which occupies the lower five bits. Concatenating the operation code and address yields 100 10010, i.e., 0b10010010. Option C matches this pattern. Options A, B, and D contain different operation codes (110, 101, 111) and therefore would invoke unrelated instructions such as ADD, SUB, or JMP, making them incorrect for the desired store operation.
Q4. Which addressing mode does SAP-III use when an instruction contains a literal value prefixed by ‘#’?
📖 Explanation: In SAP‑III, a literal value preceded by ‘#’ indicates that the value is taken directly from the instruction itself rather than fetched from memory. This is the definition of immediate addressing, where the operand is embedded in the instruction word. Direct addressing would use a memory address without the ‘#’, indirect would require an extra level of indirection, and indexed would involve adding an index register to a base address. Hence option A is the correct description of the immediate mode.
Q5. Why is the SAP-III instruction set considered a historical predecessor of the Intel 8080 microprocessor?
📖 Explanation: The SAP‑III’s design centered on an accumulator‑based architecture and employed a compact opcode format that directly influenced the later 8080 design. This similarity in architectural philosophy and opcode organization is why historians view SAP‑III as a predecessor. Option A is incorrect because the SAP‑III is an 8‑bit system with a much simpler bus. Option C is false; clock speeds differed. Option D is inaccurate—different companies created the two processors. Therefore, option B accurately captures the historical relationship.