TK2633: MICROPROCESSOR - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

TK2633: MICROPROCESSOR

Description:

Loop is used to update counter value and every iteration the number is inspected ... The simplest method, is to use the LDA and STA instruction to transfer each byte. ... – PowerPoint PPT presentation

Number of Views:79
Avg rating:3.0/5.0
Slides: 19
Provided by: powe51
Category:

less

Transcript and Presenter's Notes

Title: TK2633: MICROPROCESSOR


1
TK2633MICROPROCESSOR INTERFACING
  • Programming Techniques

2
LOOPING
  • The programming technique used to instruct the
    MPU to repeat task.
  • Continuous loop
  • Conditional loop
  • Repeat task until certain conditions are met.
  • Some loop include indexing along with counter.
  • Indexing pointing or referencing objects with
    sequential numbers, i.e. data in memory are
    accessed by referencing to their memory locations.

3
COUNTER
  • Counter.
  • Counter is constructed by loading a number to any
    register.
  • Then use INR or DCR to increment or decrement the
    number respectively.
  • Loop is used to update counter value and every
    iteration the number is inspected to check
    whether the number is at maximum or minimum.

Rajah 1
4
BLOCK DATA TRANSFERS
  • In many systems, blocks of information are
    transferred from one place to another in the
    microprocessors memory.
  • Transferring Blocks of Bytes.
  • Transferring Blocks of Words.

Rajah 1
5
BLOCK DATA TRANSFERS
  • Suppose that a block of 10 bytes of data,
    beginning at memory location 2080H, is
    transferred to a block of memory beginning at
    location 2090H.
  • The simplest method, is to use the LDA and STA
    instruction to transfer each byte.
  • Long program
  • A more efficient way to transfer a block of data
    uses the programmed-loop and counter.

Rajah 1
6
Flowchart
  • Flowchart required to transfer a block of bytes
    from one area of memory to another .

7
Transfer 10 bytes of data
8
BLOCK DATA TRANSFERS
  • The program uses
  • the HL register pair to indirectly address the
    source block of data.
  • The DE register pair to indirectly address the
    destination block.
  • Transfers use the MOV A,M instruction to load the
    accumulator from a source block memory location.
  • Next, the STAX D instruction stores the
    accumulator data into a destination block memory
    location.
  • The B register functions as a counter in this
    example.

Rajah 1
9
BLOCK DATA TRANSFERS
  • Large- byte block transfer gt256 (FF) bytes?
  • Program requires a register pair as the counter.
  • Example
  • A block of bytes beginning at location 01OOH is
    transferred to a block beginning at location
    2800H.
  • The length of this block is 300 (12CH) bytes.

10
BLOCK DATA TRANSFERS
11
Transferring Blocks of Words
  • In certain applications, 16-bit words of data
    must be transferred.

12
Transferring Blocks of Words
Main Program
13
Transferring Blocks of Words
14
BLOCK EXCHANGES
  • Block exchanges are similar to block transfers
    except that the data are taken from one block of
    memory and exchanged with the data in a second
    block of memory.
  • Their main application is in sorting character
    strings and numeric data.

15
Byte Block Exchanges
  • Suppose that we must exchange the 80H bytes of
    memory beginning at location 2800H with the 80H
    bytes of memory beginning at location 2880H.

16
Byte Block Exchanges
17
Word Block Exchanges Exercise
  • Suppose that we must exchange the 500H words of
    memory beginning at location 9000H with the 500H
    words of memory beginning at location 9100H.

18
Thank youQA
Write a Comment
User Comments (0)
About PowerShow.com