Addressing Modes Immediate & Direct with examples

UmerFarooqDar2 10 views 7 slides Nov 21, 2022
Slide 1
Slide 1 of 7
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7

About This Presentation

Addressing modes in computers and machines with respect to memory and serial buses with examples.


Slide Content

Umar Farooq Dar (18 TL 08) Section –II, Group: B1 Topic: Addressing Modes Immediate & Direct with examples Subject: Microprocessor & Microcontroller Date: 21-07-2020

Outline for the topic Need and importance of the Immediate & Direct Addressing Mode Mechanism/Working principle Examples through instructions and programs Real Time Application (Utilization) – (PBL based Case Study)

Need and Importance Why do we need addressing modes in microprocessor? Addressing modes are required for efficiency. They provide flexibility to programmer to access data as per his convenience. Different addressing modes allows to make code simpler and efficient Why Immediate & Direct Addressing Modes? In Immediate Mode, we can provide data in the instruction itself. In Direct Mode, we can use address where the data is located.

Mechanism & Examples How Immediate Addressing Mode is used In this mode, data is specified in instruction itself, immediately after the register. Ex: MVI B 45 (move the data 45H to register B) How Direct Addressing Mode is used In this mode, data is directly copied from the given address to the register. Ex: ADD AL,[0301] (add contents of address 0301 to AL)

PBL Based Case Study (Immediate Mode) Phase 1: Present or Identify the Problem Load a 16-bit data 2034H in A Phase 2: Develop a Plan For 16-bit data we need 3-bytes, that is achieved by use of register pair. Phase 3: Implement the Plan LXI H, 2034H Phase 4: Evaluate the Implementation LXI indicates L =Load X =Pair I =Immediate Mode H indicates First Register in pair i.e. HL pair 2034H is the data used directly in instruction because we are using Immediate Mode

PBL Based Case Study (Direct Mode) Phase 1: Present or Identify the Problem We need to send output data from USB port having address 0005 Phase 2: Develop a Plan For sending data out from a specific address of port, we can use OUT OP Code in Direct Addressing mode. Phase 3: Implement the Plan OUT 0005 Phase 4: Evaluate the Implementation OUT is an OP Code used in direct addressing mode for dealing with output data. 0005 is the address of USB from which we want to send output

Q / A Any questions regarding the presentation topic or overall are welcomed.