Thanks to visit codestin.com
Credit goes to www.scribd.com

83% found this document useful (6 votes)
7K views11 pages

Addressing Mode Numerical ExampleBCA (TU) Second Semester

1. The document describes 9 different addressing modes used in loading data from memory to an accumulator (AC) register in a processor. 2. It provides examples of calculating the effective address and obtaining the operand value for each addressing mode based on the memory layout and register values provided. 3. The addressing modes include immediate, register, register indirect, direct, indirect, relative, index, autoincrement, and autodecrement.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
83% found this document useful (6 votes)
7K views11 pages

Addressing Mode Numerical ExampleBCA (TU) Second Semester

1. The document describes 9 different addressing modes used in loading data from memory to an accumulator (AC) register in a processor. 2. It provides examples of calculating the effective address and obtaining the operand value for each addressing mode based on the memory layout and register values provided. 3. The addressing modes include immediate, register, register indirect, direct, indirect, relative, index, autoincrement, and autodecrement.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Example problem

Address Memory
PC 200 200 Load to AC Mode PC = Program Counter
R1 = Register
201 Address = 500
R1 400 XR = Index Register
202 Next Instruction AC = Accumulator
XR 100
399 450 • Memory is having first instruction to load AC
AC 400 700 • Mode will specify the addressing mode to get operand.
• Address field of instruction is 500.

500 800

600 900 Find out the effective address of operand and


operand value by considering different
702 325 addressing modes.

800 300
Ali Asghar Manjotho, Lecturer CSE-MUET
Example problem
Address Memory
PC 200 200 Load to AC Mode 1. Immediate Addressing Mode
201 Address = 500
R1 400 • As instruction contains immediate number 500.
202 Next Instruction
• It is stored as address 201.
XR 100
399 450
AC 400 700 Effective Address = 201
Operand = 500
500 800

AC 500
600 900

702 325

800 300
Ali Asghar Manjotho, Lecturer CSE-MUET
Example problem
Address Memory
PC 200 200 Load to AC Mode 2. Register Addressing Mode
201 Address = 500
R1 400 • Register R1 contains 400.
202 Next Instruction
• As operand is in register so no any memory location.
XR 100
399 450
AC 400 700 Effective Address = Nil
Operand = 400
500 800

AC 400
600 900

702 325

800 300
Ali Asghar Manjotho, Lecturer CSE-MUET
Example problem
Address Memory
PC 200 200 Load to AC Mode 3. Register Indirect Addressing Mode
201 Address = 500
R1 400 • Register R1 contains 400.
202 Next Instruction
• So effective address of operand is 400.
XR 100 • The data stored at 400 is 700.
399 450
AC 400 700
Effective Address = 400
500 800
Operand = 700

AC 700
600 900

702 325

800 300
Ali Asghar Manjotho, Lecturer CSE-MUET
Example problem
Address Memory
PC 200 200 Load to AC Mode 4. Direct Addressing Mode
201 Address = 500
R1 400 • Instruction contains the address 500.
202 Next Instruction
• So effective address of operand is 500.
XR 100 • The data stored at 500 is 800.
399 450
AC 400 700
Effective Address = 500
500 800
Operand = 800

AC 800
600 900

702 325

800 300
Ali Asghar Manjotho, Lecturer CSE-MUET
Example problem
Address Memory
PC 200 200 Load to AC Mode 5. Indirect Addressing Mode
201 Address = 500
R1 400 • Instruction contains the address 500.
202 Next Instruction
• Address at 500 is 800.
XR 100 • So effective address of operand is 800.
399 450 • The data stored at 800 is 300.
AC 400 700

Effective Address = 800


500 800
Operand = 300

600 900
AC 300

702 325

800 300
Ali Asghar Manjotho, Lecturer CSE-MUET
Example problem
Address Memory
PC 200 200 Load to AC Mode 6. Relative Addressing Mode
201 Address = 500
R1 400 • PC = 200.
202 Next Instruction
• Offset = 500.
XR 100 • Instruction is of 2 bytes.
399 450 • So effective address = PC + 2 + offset = 200 + 500 +2 =
AC 400 700 702 .
• The data stored at 702 is 325.
500 800
Effective Address = 702
600 900 Operand = 325

702 325
AC 325

800 300
Ali Asghar Manjotho, Lecturer CSE-MUET
Example problem
Address Memory
PC 200 200 Load to AC Mode 7. Index Addressing Mode
201 Address = 500
R1 400 • XR = 100.
202 Next Instruction
• Base = 500.
XR 100 • So effective address = Base + XR = 500 + 100 = 600 .
399 450 • The data stored at 600 is 900.
AC 400 700

Effective Address = 600


500 800
Operand = 900

600 900
AC 900

702 325

800 300
Ali Asghar Manjotho, Lecturer CSE-MUET
Example problem
Address Memory
PC 200 200 Load to AC Mode 8. Autoincrement Addressing Mode
201 Address = 500
R1 400 • It is same as register indirect addressing mode except
202 Next Instruction
the contents of R1 are incremented after the execution.
XR 100 • R1 contains 400.
399 450 • So effective address of operand is 400.
AC 400 700 • The data stored at 400 is 700.

500 800
Effective Address = 400
Operand = 700
600 900

R1 401
702 325
AC 700
800 300
Ali Asghar Manjotho, Lecturer CSE-MUET
Example problem
Address Memory
PC 200 200 Load to AC Mode 9. Autodecrement Addressing Mode
201 Address = 500
R1 400 • It is same as register indirect addressing mode except
202 Next Instruction
the contents of R1 are decremented before the
XR 100 execution.
399 450 • R1 contains 400.
AC 400 700 • R1 is first decremented to 399.
• So effective address of operand is 399.
• The data stored at 399 is 450.
500 800

600 900 Effective Address = 399


Operand = 450
702 325 R1 399

800 300 AC 450


Ali Asghar Manjotho, Lecturer CSE-MUET
Example problem
Addressing Mode Effective Address Operand
Immediate Addressing Mode 201 500
Register Addressing Mode Nil 400
Register Indirect Addressing Mode 400 700
Direct Addressing Mode 500 800
Indirect Addressing Mode 800 300
Relative Addressing Mode 702 325
Indexed Addressing Mode 600 900
Autoincrement Addressing Mode 400 700
Autodecrement Addressing Mode 399 450

Ali Asghar Manjotho, Lecturer CSE-MUET

You might also like