Instruction Set and Addressing questions

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

Q52

GATE CS 2017 CS-1Instruction Set and AddressingNAT2 marks
Consider the expression (a−1)∗(((b+c)/3)+d)(a-1)*(((b+c)/3)+d). Let X be the minimum number of registers required by an optimal code generation (without any register spill) algorithm for a load/store architecture, in which (i) only load and store instructions can have memory operands and (ii) arithmetic instructions can have only register or immediate operands. The value of X is ____________.
Show answer without attempting

Answer: 2.0

0/30 correct0 marks

Related topics in Computer Organization and Architecture