Addressing-Modes

Question 1

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

A
Post-increment addressing mode, (R1)+
B
Pre-decrement addressing mode, -(R1)
C
Register direct addressing mode, R1
D
Index addressing mode, X(R1), where X is an offset represented in 2’s complement 16-bit representation
       Computer-Organization       Addressing-Modes       GATE 2017 [Set-1]
Question 1 Explanation: 
sruct data
{
int marks[100];
char grade;
int cnumber;
}; struct data student
Base Address of student is available in R1.
So student.grade can be accessed efficiently by Relative Indexed Addressing Mode.
It is clearly mentioned X is the offset address to be summed with Base Address of R1.

Hence Index Addressing mode X(R1), where X is an offset represented in 2’s complement 16-bit representation.
⇾ Relative, Base Indexed & all subtypes of Indirect addressing modes are used with Arrays.
Question 2

Which of the following is/are true of the auto-increment addressing mode?

    I. It is useful in creating self-relocating code
    II. If it is included in an Instruction Set Architecture, then an additional ALU is required for effective address calculation
    III. The amount of increment depends on the size of the data item accessed
A
I only
B
II only
C
III Only
D
II and III only
       Computer-Organization       Addressing-Modes       GATE 2008
Question 2 Explanation: 
I. Self relocating code always takes some address in memory. So auto-increment mode is not used for self relocating code. Hence this statement is wrong.
II. An additional ALU is not necessary for auto-increment. So this statement is wrong.
III. In auto-increment addressing mode the address where next data block to be stored is generated automatically depending upon the size of single data item required to store. This is based on pointer arithmetic. So this statement is true.
Hence option C is the answer.
Question 3

Which of the following addressing modes are suitable for program relocation at run time?

(i)  Absolute addressing     (ii) Based addressing
(iii) Relative addressing     (iv) Indirect addressing 
A
(i) and (iv)
B
(i) and (ii)
C
(ii) and (iii)
D
(i), (ii) and (iv)
       Computer-Organization       Addressing-Modes       GATE 2004
Question 3 Explanation: 
Absolute Addressing:
A fixed address in memory which indicates a location by specifying a distance from another location. In this displacement type addressing is preferred.
So, option A is false.
Based Addressing:
This scheme is used by computers to control access to memory. In this pointers are replaced by protected objects which can be executed by kernel (or) some other privileged process authors.
So, this is suitable for program relocation at runtime.
Relative Addressing:
The offset of the relative addressing is to allow reference to code both before and after the instruction.
This is also suitable.
Indirect Addressing:
Which leads to extra memory location which can be not suitable at run time.
This is not suitable.
→ Only Based Addressing and Relative Addressing are suitable.
Question 4

In the absolute addressing mode

A
the operand is inside the instruction
B
the address of the operand is inside the instruction
C
the register containing the address of the operand is specified inside the instruction
D
the location of the operand is implicit
       Computer-Organization       Addressing-Modes       GATE 2002
Question 4 Explanation: 
The operand is inside the instruction---Immediate addressing.
The operand is inside the instruction --- absolute addressing.
The register containing the address of the operand is specified inside the instruction --- Register addressing.
The location of the operand is implicit --- Implicit addressing.
Question 5

A certain processor supports only the immediate and the direct addressing modes. Which of the following programming language features cannot be implemented on this processor?

A
Pointers
B
Arrays
C
Records
D
Recursive procedures with local variable
E
All the above
       Computer-Organization       Addressing-Modes       GATE 1999
Question 5 Explanation: 
A) Cannot be implemented because pointers need indirect addressing mode.
B) Cannot be implemented because arrays need Register indexing.
C) Records also needs pointers which needs indirect addressing modes, so this also cannot be implemented.
D) Recursive procedures needs stack, and so it needs stack pointers which in turn needs indirect addressing. So this also cannot be implemented.
Question 6

Which of the following addressing modes permits relocation without any change whatsoever in the code?

A
Indirect addressing
B
Indexed addressing
C
Base register addressing
D
PC relative addressing
       Computer-Organization       Addressing-Modes       GATE 1998
Question 6 Explanation: 
In PC relative addressing there is no change in the code.
Question 7

Relative mode of addressing is most relevant to writing

A
coroutines
B
position – independent code
C
shareable code
D
interrupt handlers
       Computer-Organization       Addressing-Modes       GATE 1996
Question 7 Explanation: 
The main advantage of PC- relative addressing is that code may be position independent, i.e., it can be loaded anywhere in memory without the need to adjust any address.
Question 8

The most relevant addressing mode to write position-independent codes is:

A
Direct mode
B
Indirect mode
C
Relative mode
D
Indexed mode
       Computer-Organization       Addressing-Modes       GATE 1987
Question 8 Explanation: 
Relative mode since we can just change the content of base register, if we wish to relocate.
Question 9

Which of the following statements about relative addressing mode is FALSE?

A
It enables reduced instruction size
B
It allows indexing of array elements with same instruction
C
It enables easy relocation of data
D
It enables faster address calculations than absolute addressing
       Computer-Organization       Addressing-Modes       GATE 2006-IT
Question 9 Explanation: 
As relative address are calculated from the absolute address. So relative addressing cannot be faster than absolute addressing.
Question 10
The most appropriate matching for the following pairs :
A
X − 3, Y − 2, Z −1
B
X − 2, Y − 3, Z −1
C
X − 3, Y −1, Z − 2
D
X − 2, Y −1, Z − 3
       Computer-Organization       Addressing-Modes       ISRO-2017 May
Question 10 Explanation: 
Indirect addressing:
Indirect addressing means that the address of the data is held in an intermediate location so that the address is first 'looked up' and then used to locate the data itself.
Immediate addressing:
Immediate Addressing. An immediate operand has a constant value or an expression. When an instruction with two operands uses immediate addressing, the first operand may be a register or memory location, and the second operand is an immediate constant. Auto increment or decrements: can be one by using loops.
Question 11
Relative mode of addressing is most relevant to writing
A
Coroutines
B
Position-independent code
C
Shareable code
D
Interrupt Handlers
       Computer-Organization       Addressing-Modes       ISRO-2016
Question 11 Explanation: 
The main advantage of PC- relative addressing is that code may be position independent, i.e., it can be loaded anywhere in memory without the need to adjust any address.
Question 12
Which of the following is/are true of the auto-increment addressing mode?
I. It is useful in creating self-relocating code
II. If it is included in an Instruction Set Architecture, then an additional ALU is required for effective address calculation
III. The amount of increment depends on the size of the data item accessed
A
I only
B
II only
C
III only
D
) II only
       Computer-Organization       Addressing-Modes       ISRO CS 2009
Question 12 Explanation: 
After determining the effective address, the value in the base register is incremented by the size of the data item that is to be accessed.
For example, (A7)+ would access the content of the address register A7, then increase the address pointer of A7 by 1 (usually 1 word). Within a loop, this addressing mode can be used to step through all the elements of an array or vector.
Question 13
In which addressing mode, the effective address of the operand is generated by adding a constant value to the content of a register?
A
Absolute mode
B
Indirect mode
C
Immediate mode
D
Index mode
       Computer-Organization       Addressing-Modes       ISRO CS 2009
Question 13 Explanation: 
1. An absolute address is represented by the contents of a register. This addressing mode is absolute in the sense that it is not specified relative to the current instruction address.

2. Indirect addressing is a scheme in which the address specifies which memory word or register contains not the operand but the address of the operand.

Immediate Operand:

The simplest way for an instruction to specify an operand is for the address part of the instruction actually to contain the operand itself rather than an address or other information describing where the operand is. Such an operand is called an immediate operand because it is automatically fetched from memory at the same time the instruction itself is fetched. It is immediately available for use.

Index mode:

The address of the operand is obtained by adding to the contents of the general register (called index register) a constant value. The number of the index register and the constant value are included in the instruction code
Question 14
Which of the following statements about relative addressing mode is FALSE?
A
It enables reduced instruction size
B
It allows indexing of array element with same instruction
C
It enables easy relocation of data
D
It enables faster address calculation than absolute addressing
       Computer-Organization       Addressing-Modes       ISRO CS 2009
Question 14 Explanation: 
Relative address means an address specified by indicating its distance from another address, called the base address.
In absolute addressing, you specify the actual address (called the absolute address) of a memory location.
Question 15
A certain processor supports only the immediate and the direct addressing modes. Which of the following programming language features cannot be implemented on this processor?
A
Pointers
B
Arrays
C
Records
D
All of these
       Computer-Organization       Addressing-Modes       Nielit Scientist-B CS 2016 march
Question 15 Explanation: 
→ Pointer access requires indirect addressing which can be simulated with indexed addressing or register indirect addressing but not with direct and immediate addressing.
→ An array and record access needs a pointer access. So, options (A), (B) and (C) cannot be implemented on such a processor.
→ Now to handle recursive procedure we need to use stack. A local variable inside the stack will be accessed as *(SP+Offset) which is nothing but a pointer access and requires indirect addressing. Usually this is done by moving the SP value to the base register and then using base register addressing to avoid unnecessary memory access for indirect addressing but not possible with just direct and immediate addressing.
Question 16
The addressing mode used in the instruction PUSH B is
A
Direct
B
Register
C
Register indirect
D
Immediate
       Computer-Organization       Addressing-Modes       NieLit STA 2016 March 2016
Question 16 Explanation: 
There are four types of instruction: –
PUSH A, PUSH B, add α popc
Wherein addressing mode used are as follows: –
PUSH A – Direct
PUSH B – Register
Add – Register indirect
Pop.C – Immediate
Question 17

Consider the following statements :

    (i) Auto increment addressing mode is useful in creating self-relocating code.
    (ii) If auto addressing mode is included in an instruction set architecture, then
         an additional ALU is required for effective address calculation.
    (iii) In auto increment addressing mode, the amount of increment depends on
         the size of the data item accessed.

Which of the above statements is/are true ?

Choose the correct answer from the code given below :

Code :
A
(iii) only
B
(ii) and (iii) only
C
(i) and (ii) only
D
(ii) only
       Computer-Organization       Addressing-Modes       UGC-NET CS 2018 DEC Paper-2
Question 17 Explanation: 
→ Auto increment addressing mode is useful in implementing arrays.
→ After determining the effective address, the value in the base register is incremented by the size of the data item that is to be accessed. For example, (A7)+ would access the content of the address register A7, then increase the address pointer of A7 by 1 (usually 1 word).
→ Within a loop, this addressing mode can be used to step through all the elements of an array or vector.
Question 18
The addressing mode used in an instruction of the form ADD X Y, is___
A
Direct
B
Absolute
C
Indirect
D
Indexed
       Computer-Organization       Addressing-Modes       Nielit Scientist-B CS 4-12-2016
Question 18 Explanation: 
● In direct addressing mode, the offset value is specified directly as part of the instruction, usually indicated by the variable name.
● Indirect addressing is generally used for variables containing several elements like, arrays. Starting address of the array is stored in, say, the EBX register.
● The address of the operand is obtained by adding to the contents of the general register (called index register) a constant value. The number of the index register and the constant value are included in the instruction code. Index Mode is used to access an array whose elements are in successive memory locations.
● An absolute address is represented by the contents of a register. This addressing mode is absolute in the sense that it is not specified relative to the current instruction address.
Question 19
In X = (M + N x O)/(P x Q), how many one-address instructions are required to evaluate it?
A
4
B
6
C
8
D
10
       Computer-Organization       Addressing-Modes       ISRO CS 2015
Question 19 Explanation: 
All operations are performed with an implied accumulator register. The instruction format in this type of computer uses one address field. For example, the instruction that specifies an arithmetic addition is defined by an assembly language instruction as ADD.
Given instruction is
Instruction-1: Load the value “M” into accumulator
Instruction-2:Add the “N” value to M and store result into accumulator register
Instruction-3:Multiply “O” with the accumulator register value and store in to accumulator register
instruction-4: Store that result into Memory
Instruction-5:Load/store the value “P” into accumulator register
instruction-6:Multiply “Q” with the accumulator register value and store in to accumulator
instruction-7:Divide the memory value with the accumulator register value and store in to accumulator
Instruction-8: Store the accumulator value in the memory location.
Question 20
In which addressing mode, the operand is given explicitly in the instruction(example instruction: ADD R4,#3?
A
Based indexed mode
B
Absolute mode
C
Immediate mode
D
Register indirect mode
       Computer-Organization       Addressing-Modes       KVS DEC-2017
Question 20 Explanation: 
Here, we are adding R4+3.
Immediate mode
In immediate addressing the operand is specified in the instruction itself. In this mode the data is 8 bits or 16 bits long and data is the part of instruction.
Example: MOV AL, 35H (move the data 35H into AL register)
Question 21
The addressing mode used in an instruction of the form ADD X,Y is:
A
index
B
absolute
C
immediate
D
indirect
       Computer-Organization       Addressing-Modes       KVS DEC-2017
Question 21 Explanation: 
The addressing mode used in an instruction of the form ADD X,Y is absolute addressing mode.
Question 22
If a value V(x) of the target operand is contained in the field itself, the addressing mode is called
A
Immediate
B
Direct
C
Indirect
D
Implied
       Computer-Organization       Addressing-Modes       KVS 30-12-2018 Part B
Question 22 Explanation: 
As mentioned in the question “Target operand is contained in the field itself”. It should be immediate addressing mode
Question 23
The Register or main memory location which contains the effective address of the operand is known as :
A
Pointer
B
Indexed register
C
Special Locations
D
Scratch Pad
       Computer-Organization       Addressing-Modes       UGC NET CS 2005 Dec-Paper-2
Question 23 Explanation: 
→ The effective address of the operand is the contents of a register or main memory location, location whose address appears in the instruction.
→ Indirection is noted by placing the name of the register or the memory address given in the instruction in parentheses.
→ The register or memory location that contains the address of the operand is a pointer. When an execution takes place in such mode, instruction may be told to go to a specific address. Once it's there, instead of finding an operand, it finds an address where the operand is located.
Note:Two memory accesses are required in order to obtain the value of the operand (fetch operand address and fetch operand value).
Example: (textbook) ADD (A), R0
(address A is embedded in the instruction code and (A) is the operand address = pointer variable)
Question 24
Consider the following statements :
(i) Auto increment addressing mode is useful in creating self-relocating code.
(ii) If auto addressing mode is included in an instruction set architecture, then an additional ALU is required for effective address calculation.
(iii) In auto increment addressing mode, the amount of increment depends on the size of the data item accessed.
Which of the above statements is/are true ?
A
(iii) only
B
(ii) and (iii) only
C
(i) and (ii) only
D
(ii) only
       Computer-Organization       Addressing-Modes       UGC NET CS 2018-DEC Paper-2
Question 24 Explanation: 
→ Auto increment addressing mode is useful in implementing arrays.
→ After determining the effective address, the value in the base register is incremented by the size of the data item that is to be accessed. For example, (A7)+ would access the content of the address register A7, then increase the address pointer of A7 by 1 (usually 1 word).
→ Within a loop, this addressing mode can be used to step through all the elements of an array or vector.
Question 25
In which addressing mode, the effective address of the operand is generated by adding a constant value to the contents of register ?
A
Absolute
B
Indirect
C
Immediate
D
Index
       Computer-Organization       Addressing-Modes       UGC NET CS 2012 Dec-Paper-2
Question 25 Explanation: 
1. An absolute address is represented by the contents of a register. This addressing mode is absolute in the sense that it is not specified relative to the current instruction address.
2. Indirect addressing is a scheme in which the address specifies which memory word or register contains not the operand but the address of the operand.
Immediate Operand:
The simplest way for an instruction to specify an operand is for the address part of the instruction actually to contain the operand itself rather than an address or other information describing where the operand is. Such an operand is called an immediate operand because it is automatically fetched from memory at the same time the instruction itself is fetched. It is immediately available for use.
Index mode:
The address of the operand is obtained by adding to the contents of the general register (called index register) a constant value. The number of the index register and the constant value are included in the instruction code
Question 26
The addressing mode used in an instruction of the form ADD X Y, is
A
absolute
B
immediate
C
indirect
D
index
       Computer-Organization       Addressing-Modes       NIELIT Junior Teachnical Assistant_2016_march
Question 27
The register or main memory location which contains the effective address of the operand is known as
A
pointer
B
special location
C
indexed register
D
None of the above
       Computer-Organization       Addressing-Modes       UGC NET CS 2010 Dec-Paper-2
Question 27 Explanation: 
The register or main memory location which contains the effective address of the operand is known as pointer.
Question 28
In which addressing mode the operand is given explicitly in the instruction itself ?
A
Absolute mode
B
Immediate mode
C
Indirect mode
D
Index mode
       Computer-Organization       Addressing-Modes       UGC NET CS 2009-June-Paper-2
Question 28 Explanation: 
Immediate addressing mode the operand is given explicitly in the instruction itself.
Question 29
In which addressing mode, the effective address of the operand is generated by adding a constant value to the contents of register ?
A
absolute mode
B
immediate mode
C
indirect mode
D
index mode
       Computer-Organization       Addressing-Modes       UGC NET CS 2008 Dec-Paper-2
Question 29 Explanation: 
Absolute address is represented by the contents of a register. This addressing mode is absolute in the sense that it is not specified relative to the current instruction address.
Indirect addressing is a scheme in which the address specifies which memory word or register contains not the operand but the address of the operand.
Immediate Operand: The simplest way for an instruction to specify an operand is for the address part of the instruction actually to contain the operand itself rather than an address or other information describing where the operand is. Such an operand is called an immediate operand because it is automatically fetched from memory at the same time the instruction itself is fetched. It is immediately available for use.
Index mode: The address of the operand is obtained by adding to the contents of the general register (called index register) a constant value. The number of the index register and the constant value are included in the instruction code.
Question 30
In the indirect addressing scheme, the second part of an instruction contains :
A
the operand in decimal form
B
the address of the location where the value of the operand is stored
C
the address of the location where the address of the operand is stored
D
the operand in an encoded form
       Computer-Organization       Addressing-Modes       UGC NET CS 2008-june-Paper-2
Question 30 Explanation: 
→ In the indirect addressing scheme, the second part of an instruction contains the address of the location where the address of the operand is stored.
→ Indirect addressing is a scheme in which the address specifies which memory word or register contains not the operand but the address of the operand.
Example: LOAD R1, @R2 Load the content of the memory address stored at register R2 to register R1.
Question 31
Match the following : 
A
a-(iv), b-(iii), c-(i), d-(ii)
B
a-(iv), b-(i), c-(iii), d-(ii)
C
a-(iv), b-(ii), c-(i), d-(iii)
D
a-(iv), b-(iii), c-(ii), d-(i)
       Computer-Organization       Addressing-Modes       UGC NET CS 2017 Jan- paper-3
Question 31 Explanation: 
Implied → Specified implicitly in the definition of instruction
Immediate→ Registers which are in CPU
Register→ Specified in the register
Register Indirect→ Specified implicitly in the definition of instruction
Question 32
The _____ addressing mode is similar to register indirect addressing mode, except that an offset is added to the contents of the register. The offset and register are specified in the instruction.
A
Base indexed
B
Base indexed plus displacement
C
Indexed
D
Displacement
       Computer-Organization       Addressing-Modes       UGC NET CS 2016 July- paper-3
Question 33
Which type of addressing mode, less number of memory references are required?
A
Immediate
B
Implied
C
register
D
indexed
E
None of the above
       Computer-Organization       Addressing-Modes       UGC NET June-2019 CS Paper-2
Question 33 Explanation: 
Excluded for evaluation
Question 34
A computer uses a memory unit of 512 K words of 32 bits each. A binary instruction code is stored in one word of the memory. The instruction has four parts: an addressing mode field to specify one of the two-addressing mode (direct and indirect), an operation code, a register code part to specify one of the 256 registers and an address part. How many bits are there in addressing mode part, opcode part, register code part and the address part?
A
1, 3, 9, 19
B
1, 4, 9, 18
C
1, 4, 8, 19
D
1, 8, 8, 20
       Computer-Organization       Addressing-Modes       UGC-NET DEC-2019 Part-2
Question 34 Explanation: 
Given data,
Memory unit= 512K words
512K words of 32 bits each.
Binary instruction code stored in 1 word of memory.
Instruction divided into 4 parts.
1. Operation code= ?
2. Register code= ?
3. Addressing mode (Direct and indirect)
4. Address port= ?
Addressing Mode part = 1 (Direct and indirect)
Operation Code = 32 - 1 - 18 - 8 bits = 5 bits
Register Code = 256 = 28 = 8 bits
Address port = 28 (256kB) * 210 (1024 bytes/kB) = 218 ⇒ 18 bits
final Answer is (1,5,8,18)
Note: None of the options given correct answer. We are given answer according to key given by NTA.
Question 35

An instruction is stored at location 500 with it address field at location 501. The address field has the value 400. A processor register R1 contains the number 200. Match the addressing mode (List-I) given below with effective address (List-II) for the given instruction:



Choose the correct option from those given below:
A
(a)-(iii), (b)-(i), (c)-(iv), (d)-(ii)
B
(a)-(i), (b)-(ii), (c)-(iii), (d)-(iv)
C
(a)-(iv), (b)-(ii), (c)-(iii), (d)-(i)
D
(a)-(iv), (b)-(iii), (c)-(ii), (d)-(i)
       Computer-Organization       Addressing-Modes       UGC-NET DEC-2019 Part-2
Question 35 Explanation: 

Direct Address = 400
Relative Address = Next Instruction memory location + Direct Address value
= 502 + 400
= 902
Register indirect Address= 200
Indexed Address = Register Indirect Address + Direct Address
= 200 + 400
= 600
Question 36
Which of the following addressing modes is more appropriate for accessing elements of an array?
A
Index mode
B
Auto increment mode
C
Displacement mode
D
Register mode
       Computer-Organization       Addressing-Modes       CIL Part - B
Question 36 Explanation: 
→The address of the operand is obtained by adding to the contents of the general register (called index register) a constant value.
→The number of the index register and the constant value are included in the instruction code.
→Index Mode is used to access an array whose elements are in successive memory locations. The content of the instruction code, represents the starting address of the array and the value of the index register, and the index value of the current element.
→By incrementing or decrementing index register different element of the array can be accessed.
Question 37
If the address of the operand is embedded in the instruction code itself, then the addressing mode is termed as:
A
Register mode
B
Direct mode
C
Displacement mode
D
Immediate mode
       Computer-Organization       Addressing-Modes       CIL Part - B
Question 37 Explanation: 
In direct mode, the effective address of operand is present in the instruction itself.
Single memory reference to access data.
No additional calculations to find the effective address of the operand.
Question 38
The immediate addressing mode can be used for
1. Loading internal registers with initial values
2. Perform arithmetic or logical operations on data contained in instructions Which of the following is true?
A
Only 1
B
Only 2
C
Both 1 and 2
D
Immediate mode refers to data in cache
       Computer-Organization       Addressing-Modes       ISRO CS 2020
Question 38 Explanation: 
Immediate addressing mode can be used for both loading registers with initial values and for performing arithmetic or logical operations on data contained in instructions.
Question 39
A stack organised computer is characterised by instructions with
A
Indirect addressing
B
Direct addressing
C
Zero addressing
D
Index addressing
       Computer-Organization       Addressing-Modes       ISRO CS 2020
Question 39 Explanation: 
A stack organized computer is characterized by zero address instructions which will perform operations on the top elements of the stack.
For example ADD will do addition of top two elements of the stack and puts the result as the top most element.
Question 40
The addressing modes used in the machine instruction ADD X, Y is
A
Direct
B
Indirect
C
Immediate
D
Implied addressing
       Computer-Organization       Addressing-Modes       APPSC-2016-DL-CS
Question 40 Explanation: 
in immediate addressing mode in operand part directly operand is given.But in the given machine instruction it is not the case.
More over in indirect addresing mode @X should have been given which is a notation for indirect addressing mode.
In implied addressing mode operand is appended in the opcode itself which is not in the above instruction.
Hence the given instruction is direct addressing mode. In direct addressing mode the address of operand is present in the operand part of instruction.
Question 41
The most relevant addressing mode to write position independent code is
A
Direct mode
B
Indirect mode
C
Relative mode
D
Indexed mode
       Computer-Organization       Addressing-Modes       TNPSC-2012-Polytechnic-CS
Question 41 Explanation: 
Relative mode is the most relevant addressing mode to write position independent code.
Indexed mode is for arrays and structure.
Indirect mode is used for pointers.
There are 41 questions to complete.
PHP Code Snippets Powered By : XYZScripts.com
error: Content is protected !!