This document discusses addressing modes and provides examples of different addressing mode instructions. It then presents and solves problems related to effective addresses and loading values from memory using different addressing modes. The document is prepared by I. Mala Serene and provides references for additional reading on computer organization and architecture.
Original Description:
Original Title
FALLSEM2021-22 ITE2001 TH VL2021220105091 Reference Material I 23-08-2021 Addressing Mode Problems (1)
This document discusses addressing modes and provides examples of different addressing mode instructions. It then presents and solves problems related to effective addresses and loading values from memory using different addressing modes. The document is prepared by I. Mala Serene and provides references for additional reading on computer organization and architecture.
This document discusses addressing modes and provides examples of different addressing mode instructions. It then presents and solves problems related to effective addresses and loading values from memory using different addressing modes. The document is prepared by I. Mala Serene and provides references for additional reading on computer organization and architecture.
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
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