Immediate value in the Instruction Direct register reference

Immediate value (in the Instruction) Direct register reference Direct memory reference Indirect through a register Indirect memory reference Illustration of the hardware units accessed when fetching an operand in various addressing modes. Indirect references take longer than direct references. Consider the following assembly code. LOAD R4, 12 + R9; list modes here in order, separated by commas ADD R6, R5, R4; list modes for ADD here Using the memory access types framework of text Figure 7.6, categorize the addressing mode for each operand and result within each of the above assembly language instructions. Each instruction will have three answers to be listed. What addressing occurs, if any, in the instructions in part (a) that was not captured your answer about addressing for operands and results? When will a program use the direct register addressing mode? What does a program use the immediate value mode for?

Solution

Given Assembly Code:

Question1:

LOAD R4, 12+R9

It will load the immediate value of Register R9 + 12 into register R4. (Immediate Mode)

ADD R6, R5, R4

It will add the content of Register R4 with content of Register R5 , then will store the value in R6.

Here no memory access is required,hence Direct Register Reference mode.

Question 2:

No other address mode will be captured for the above instruction.

Question 3:

Whenever the instructions uses address field instead of the memory reference, Direct register addressing mode will be used. One of the disadvantage in using Direct register address is the address space is very limted.

Question 4 :

It is the simplest addressing mode in which the operand is available in the instruction itself. It will allow you to declare and use constant or set intial values for variables.It doesn\'t need the memory reference to acquire the operand.

Ex : move #400, R2; // move immediate value 400 in register R2.

 Immediate value (in the Instruction) Direct register reference Direct memory reference Indirect through a register Indirect memory reference Illustration of th

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site