Multiple choice assembly

What is the memory-addressing mode of the first operand in the MOV instruction? for the following program segment:

Age DB 100 
MOV Age,123

  1. Immediate addressing mode

  2. direct addressing mode

  3. Indirect addressing mode

  4. none of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In the instruction MOV Age, 123, the first operand is the memory variable Age, which is accessed directly by its label. This represents direct addressing mode because the address of the operand is explicitly given in the instruction. Immediate addressing is used for constant values like 123, not memory locations.

AI explanation

To answer this question, we need to understand the different memory-addressing modes in assembly language.

In the given program segment:

Age DB 100
MOV Age,123

The instruction MOV Age,123 is used to move the immediate value 123 into the memory location labeled as "Age".

Let's go through each option to understand why it is correct or incorrect:

Option A) Immediate addressing mode - This option is incorrect because immediate addressing mode involves directly specifying the value to be operated on, rather than specifying a memory location.

Option B) Direct addressing mode - This option is incorrect because direct addressing mode involves specifying a memory location directly, without any indirection or additional steps. In this case, "Age" is a memory location, but it is not directly specified as the operand.

Option C) Indirect addressing mode - This option is correct because indirect addressing mode involves specifying a memory location indirectly through a register or pointer. In this case, "Age" is indirectly specified as the operand.

Option D) None of the above - This option is incorrect because the correct answer is option C, indirect addressing mode.

Therefore, the correct answer is option C. The memory-addressing mode of the first operand in the MOV instruction is indirect addressing mode.