Microprocessors - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Microprocessors

Description:

MOV DPTR, #2550H ... 64Kb RAM addresses, the data pointer (DPTR) must be loaded with a 16 bit ... Use the DPTR to point to external RAM and ROM addresses. ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 18
Provided by: davidlk2
Category:

less

Transcript and Presenter's Notes

Title: Microprocessors


1
Microprocessors
  • Addressing Modes, Ch5

2
Immediate Addressing Mode
  • Immediate data preceded by .
  • Used to load data into any programmable register.
  • Immediate data is stored in ROM with the
    application program.

3
MOV DPTR, 2550H
  • To access 64Kb RAM addresses, the data pointer
    (DPTR) must be loaded with a 16 bit RAM address.
  • The low byte register of the DPTR is DPL.
  • The high byte register of the DPTR is DPH.

4
Using the EQU directive for immediate data.
COUNT EQU 30 MYDATA EQU 200H MOV R4,
COUNT MOV DPTR, MYDATA or COUNT EQU
30 MOV R4, COUNT MOV DPTR, MYDATA DPTR
200H ORG 200H MYDATA IS 200HMYDATA DB
America
Demonstrates that labels are addresses.
5
Register Addressing Mode
  • Register addressing conserves ROM and executes
    faster than direct addressing.
  • Examples
  • MOV A, Rn
  • MOV Rn, A
  • MOV Rn, 40H

register addressing
direct addressing
6
Direct Addressing Mode
  • Can address 00H to 7FH of on-board RAM.
  • Most often used to address 30H to 7FH.
  • SFRs can be direct addressed.
  • Non SFR addresses between 80H and FFH are off
    limits to the programmer.
  • Stack instructions require direct addressing.

7
Register Indirect Addressing Mode
  • R0 and R1 may be pointer registers.
  • Use _at_ to indicate that R0 or R1 is a pointer.
  • R0 and R1 can point only to on chip RAM
    addresses.
  • Use the DPTR to point to external RAM and ROM
    addresses.

8
Register Indirect Addressing Mode (Program
Example)
MOV R0, 35H source pointer MOV R1, 60H
destination pointer MOV A, _at_R0 get a byte
from address 35H MOV _at_R1, A copy that byte
into 60H
9
Look-up Table in Code Memory
ORG 0 MOV DPTR, 300H MOV A,
0FFH MOV P1, A BACK MOV A, P1 MOVC
A, _at_ADPTR MOV P2, A SJMP BACK ORG
300HXSQR_TABLE DB 0,1,4,9,16,25,36,49,64,81 E
ND
10
Look-up Table in Code Memory
MOV DPTR, 300H
MOV A, 0FFHMOV P1, A
MOV A, P1
MOVC A, _at_ADPTR
MOV P2, A
11
(No Transcript)
12
(No Transcript)
13
(No Transcript)
14
(No Transcript)
15
Thats 4 squared!
16
(No Transcript)
17
A word about MOVC
  • MOVC gets a byte from code memory.
  • MOVC A, _at_ADPTR uses the data pointer
  • MOVC A, _at_APC uses the program counter.
Write a Comment
User Comments (0)
About PowerShow.com