Addressing Modes questions

Q14

GATE CS 2026 CS-1Instruction Set and AddressingMCQ1 mark−1/3 if wrong
Match each addressing mode in List I with a data element or an element of a data structure (in a high-level language) in List II:

List I
P. Immediate
Q. Indirect
R. Base with index
S. Base with offset/displacement

List II
1. Element of an array
2. Pointer
3. Element of a record
4. Constant
Question figure
Show answer without attempting

Answer: B

Q33

GATE CS 2024 CS-1Instruction Set and AddressingNAT1 mark
Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below.

The value of the expression 3+1+5∗2/7+2−4−7−6/23 + 1 + 5 * 2 / 7 + 2 - 4 - 7 - 6 / 2 as per the above rules is __________
OperatorPrecedenceAssociativity
+ HighestLeft
- HighRight
* MediumRight
/ LowRight
Show answer without attempting

Answer: 6

Q57

GATE CS 2024 CS-2Instruction Set and AddressingNAT2 marks
A processor with 16 general purpose registers uses a 32-bit instruction format. The instruction format consists of an opcode field, an addressing mode field, two register operand fields, and a 16-bit scalar field. If 8 addressing modes are to be supported, the maximum number of unique opcodes possible for every addressing mode is _________
Show answer without attempting

Answer: 32

Q55

GATE CS 2021 CS-1Instruction Set and AddressingNAT2 marks
Consider the following instruction sequence where registers R1, R2 and R3 are general purpose and MEMORY[X] denotes the content at the memory location X.
InstructionSemanticsInstruction Size (bytes)
MOV R1, (5000)R1 ← MEMORY[5000]4
MOV R2, (R3)R2 ← MEMORY[R3]4
ADD R2, R1R2 ← R1+R22
MOV (R3), R2MEMORY[R3] ← R24
INC R3R3 ← R3+12
DEC R1R1 ← R1-12
BNZ 1004Branch if not zero to the given absolute address2
HALTStop1
Assume that the content of the memory location 5000 is 10, and the content of the register R3 is 3000. The content of each of the memory locations from 3000 to 3010 is 50. The instruction sequence starts from the memory location 1000. All the numbers are in decimal format. Assume that the memory is byte addressable.
After the execution of the program, the content of memory location 3010 is ______.
Show answer without attempting

Answer: 50

Q11

GATE CS 2017 CS-1Instruction Set and AddressingMCQ1 mark−1/3 if wrong
Consider the C struct defined below:
struct data {
    int marks[100];
    char grade;
    int cnumber;
};
struct data student;
The base address of student is available in register R1. The field student.grade can be accessed efficiently using
Show answer without attempting

Answer: D

Q49

GATE CS 2017 CS-1Instruction Set and AddressingNAT2 marks
Consider a RISC machine where each instruction is exactly 44 bytes long. Conditional and unconditional branch instructions use PC-relative addressing mode with Offset specified in bytes to the target location of the branch instruction. Further the Offset is always with respect to the address of the next instruction in the program sequence. Consider the following instruction sequence

Instr. No.‾Instruction‾i:add R2,R3,R4i+1:sub R5,R6,R7i+2:cmp R1,R9,R10i+3:beq R1,Offset\begin{array}{rll} \underline{\text{Instr. No.}} & & \underline{\text{Instruction}} \\ i & : & \text{add } R2, R3, R4 \\ i+1 & : & \text{sub } R5, R6, R7 \\ i+2 & : & \text{cmp } R1, R9, R10 \\ i+3 & : & \text{beq } R1, \text{Offset} \end{array}

If the target of the branch instruction is ii, then the decimal value of the Offset is ____________.
Show answer without attempting

Answer: -16.0

0/60 correct0 marks

Related topics in Instruction Set and Addressing