edited by
3,988 views
6 votes
6 votes

The immediate addressing mode can be used for

  1. Loading internal registers with initial values
  2. Perform arithmetic or logical operation on data contained in instructions

Which of the following is true?

  1. Only $1$
  2. Only $2$
  3. Both $1$ and $2$
  4. Immediate mode refers to data in cache
edited by

4 Answers

2 votes
2 votes
$\underline{\textbf{Answer:}\Rightarrow}\;\mathbf{c.}$

Both options are correct.

Example:

$\mathbf{Load \;X_1 \;100}$
edited by
1 votes
1 votes

The immediate addressing mode is used in many computer architectures for several purposes, such as:

  1. Initialization of variables: The immediate addressing mode is often used to initialize variables with a constant value. For example, if a program needs to set a register to a specific value, it can use the immediate addressing mode to load that value directly into the register.

  2. Arithmetic operations: Immediate addressing mode is also used in arithmetic operations where the value of the operand needs to be added, subtracted, multiplied or divided with another operand. For example, if a program needs to add two values together, it can load the first value using the immediate addressing mode and add the second value from memory.

  3. Conditional branching: Immediate addressing mode can also be used in conditional branching instructions, where the immediate value is compared to the value in a register. If the values are equal, the program branches to a specific address. This is often used in loops and decision-making structures.

  4. Input/Output operations: Immediate addressing mode can also be used in input/output operations. For example, if a program needs to output a specific value to a device, it can use the immediate addressing mode to load the value into a register and then use an output instruction to send the value to the device.   

          Example 1: Initialization of variables:

         MOV  AX, 1234h ; Load the immediate value 1234h into the AX register

          Example 2: Arithmetic operations :

          MOV  AX, 10 ; Load the immediate value 10 into the AX register
          ADD  AX, 20 ; Add the immediate value 20 to the contents of the AX register

          Example 3: Conditional branching : 

          MOV AX, 5 ; Load the immediate value 5 into the AX register
          CMP AX, 5 ; Compare the contents of the AX register to the immediate value 5
          JE Label1 ; If the values are equal, jump to Label1.

0 votes
0 votes
Both 1 and 2 are correct for 1 point examples are there for second point example is ADD #2,#3 say this is a instruction it is in immediate mode it will simply add 2+3. It is a 2 address or 2 operand instruction.
0 votes
0 votes

C→

Both 1 and 2

 

Both options are correct

  1. Loading internal registers with initial values
  2. Perform arithmetic or logical operation on data contained in instructions
Answer:

Related questions

4 votes
4 votes
5 answers
1
Satbir asked Jan 13, 2020
4,338 views
A stack organized computer is characterised by instructions withindirect addressingdirect addressingzero addressingindex addressing
2 votes
2 votes
1 answer
2
Satbir asked Jan 13, 2020
3,115 views
Which of the following affects the processing power assuming they do not influence each otherData bus capabilityAddress schemeClock speed$3$ only$1$ and $3$ only$2$ and $...
6 votes
6 votes
5 answers
4
Satbir asked Jan 13, 2020
4,541 views
A computer which issues instructions in order, has only $2$ registers and $3$ opcodes $\text{ADD, SUB}$ and $\text{MOV}$. Consider $2$ different implementations of the fo...