Freescale semiconductor, i, Freescale semiconductor, inc – Motorola M68EZ328ADS User Manual

Page 36

Advertising
background image

Programming On-board Flash Memory

C-35

M68EZ328ADS v2.0 USER’S MANUAL

MOTOROLA

move.l

pSOURCE,A0

move.l

pTARGET,A1

move.l

pSIZE,D0

move.l

pFLASH,A5

move.l

pFLASH,A6

*******************************************

* BreakPoint Here if program flash in SDS *

*******************************************

add.l

#OFFSET1,A5

add.l

#OFFSET2,A6

**************************************************

;*****************************************

; Input Parameters:

;

a0 - (Long) Source Address

;

a1 - (Long) Target Address

;

d0 - (Long) Byte Size

;

a5 - (long) Flash Starting Address Offset1

;

a6 - (long) Flash Starting Address Offset2

;*****************************************

move.l

a0,a2

; a2 as source

move.l

a1,a3

; a3 as target

clr.l

d1

; clear d1 as counter

clr.b

d5

; clear d5 as ECHO counter

PROGRAM

ENABLE

move.w

(a2),(a3)

; Copy source to target

clr.l

d4

; clear d4 as polling counter

POLLING

cmp.l

#TIME,d4

bgt

ERROR

; if d4>#TIME, bra ERROR

add.l

#1,d4

; d4++

move.w

(a2),d2

; Compare (a0),(a1)

move.w

(a3),d3

cmp.w

d2,d3

bne

POLLING

; End of POLLING

add.l

#2,a2

add.l

#2,a3

add.l

#2,d1

cmp.b

#0,d5

bne

NO_W

ECHO

'W'

ECHO

0

NO_W

add.b

#1,d5

Freescale Semiconductor, I

Freescale Semiconductor, Inc.

For More Information On This Product,

Go to: www.freescale.com

nc.

..

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005

ARCHIVED BY FREESCALE SEMICONDUCT

OR,

INC.

2005

Advertising