You are on page 1of 9

Addressing Mode

Problems

Prepared by I. Mala Serene,, VIT University


Which of the following  are invaild  uses of  immediate addressing mode?
    a. MOV A, #24H    b.MOV R1, 30H    c. MOV R4, #60H

2. Identify the addressing mode for each of the following:


• MOV B, #34H   
• MOV A, 50H   
• MOV R2, 07      
• MOV R3, #0   
• MOV R7, 0    
• MOV R6, #7FH       
• MOV R0, A            
• MOV B, A              
• MOV A, @R0         
• MOV R7, A       
• MOV A, @R1       
• LD Acc, #5
• LD Acc, 5
• LD Acc, [5]
• LD B, [9]
• ADD A, R7
• ADD A, #100
Prepared by I. Mala Serene, AP.(SG)SCOPE, VIT University
Problems
• Which of the following  are invaild  uses of  immediate addressing mode?
•     a. MOV A, #24H    b.MOV R1, 30H    c. MOV R4, #60H
• 2. Identify the addressing mode for each of the following:
• a. MOV B, #34H  Immediate
• b. MOV A, 50H     Direct
• c. MOV R2, 07         Direct
• d. MOV R3, #0     Immediate
• e. MOV R7, 0      Direct
• f. MOV R6, #7FH      Immediate
• g. MOV R0, A             Register
• h. MOV B, A                Register
• i. MOV A, @R0           Register Indirect
• j. MOV R7, A         Register
• k. MOV A, @R1         Register Indirect

Prepared by I. Mala Serene, AP.(SG)SCOPE, VIT University


Addressing modes Example Instruction
Add R4,R3
Add R4, #3
Add R4, 100(R1)
Add R4,(R1)
Add R3, (R1 + R2)
Add R1, (1001)
Add R1, @(R3)
Add R1, (R2)+

Add R1,-(R2)
Add R1, 100(R2)[R3]

Prepared by I. Mala Serene, AP.(SG)SCOPE, VIT University


Addressing modes Example Instruction

Register Add R4,R3


Immediate Add R4, #3
Displacement Add R4, 100(R1)
Register indirect Add R4,(R1)
Indexed Add R3, (XR + R2)
Direct Add R1, (1001)
indirect Addressing Mode Add R1, @(R3)

Auto- increment Add R1, (R2)+

Auto- decrement Add R1,-(R2)

Prepared by I. Mala Serene, AP.(SG)SCOPE, VIT University


Problem1
Register R1 and R2 contain values 1800 and 3800 respectively. The word length
of the processor is 4 bytes. What is the effective address of the memory operand
in each one of the following cases?
ADD 100(R2), R6.
LOAD R6, 20(R1,R2)
STORE –(R2), R6
SUBTRACT (R2)+, R6
 

Prepared by I. Mala Serene, AP.(SG)SCOPE, VIT University


Problem1_Solution
• Register R1 and R2 contain values 1800 and 3800 respectively. The
word length of the processor is 4 bytes. What is the effective
address of the memory operand in each one of the following cases?
• ADD 100(R2), R6.
• LOAD R6, 20(R1,R2)
• STORE –(R2), R6
• SUBTRACT (R2)+, R6
•  
• Solution:
• Effective address = 100 + Contents of R2 = 100 + 3800 = 3900.
• Effective address = 20 + Contents of R1 + Contents of R2 = 20 + 1800
+ 3800 = 5620.
• Effective address = Contents of R2 – 4 = 3800 – 4 = 3796.
• Effective address = Contents of R2 = 3800.
Prepared by I. Mala Serene, AP.(SG)SCOPE, VIT University
Problem 2 and problem 3
• Given the following memory values and a one-address machine with
an accumulator, what values do the following instructions load into
the accumulator?
– Word 20 contains 40
– Word 30 contains 50
– Word 40 contains 60
– Word 50 contains 70
• Load immediate 20
• Load direct 20
• Load indirect 20
• Load immediate 30
• Load direct 30
• Load indirect 30

Prepared by I. Mala Serene, AP.(SG)SCOPE, VIT University


References
• W. Stallings, Computer organization and architecture,
Prentice-Hall,2000
• M. M. Mano, Computer System Architecture, Prentice-Hall

Prepared by I. Mala Serene, AP.(SG)SCOPE, VIT University

You might also like