Motorola DSP56301 User Manual
Page 308

A
-12
DSP56301 User’s Manual
do #6,_LOOP9 ; read number of words and starting address
movem p:(r2)+,a2 ; Get the 8 LSB from ext. P mem.
asr #8,a,a ; Shift 8 bit data into A1
_LOOP9 ;
move a1,r0 ; starting address for load
move a1,r1 ; save it in r1
; a0 holds the number of words
do a0,_LOOP10 ; read program words
do #3,_LOOP11 ; Each instruction has 3 bytes
movem p:(r2)+,a2 ; Get the 8 LSB from ext. P mem.
asr #8,a,a ; Shift 8 bit data into A1
_LOOP11 ; Go get another byte.
movem a1,p:(r0)+ ; Store 24-bit result in P mem.
nop ; movem cannot be at LA.
_LOOP10 ; and go get another 24-bit word.
bra <FINISH ; Boot from EPROM done
;========================================================================
TERMINATE
enddo ; End the loop before exit.
FINISH
; This is the exit handler that returns execution to normal
; expanded mode and jumps to the RESET vector.
andi #$0,ccr ; Clear CCR as if RESET to 0.
jmp (r1) ; Then go to starting Prog addr.
; End of bootstrap code. Number of program words: 191.
BURN
;; get PATTERN pointer
clr b #PATTERNS,r6 ;; b is the error accumulator
move #<(NUM_PATTERNS-1),m6 ;; program runs forever in
;; cyclic form
;; configure SCK0 as gpio output. PRRC register is cleared at reset.
movep b,x:M_PDRC ;; clear GPIO data register
bset #SCK0,x:M_PRRC ;; Define SCK0 as output GPIO pin
;; SCK0 toggles means test pass
do #9,burn1
;;----------------------------
;; test RAM
;; each pass checks 1 pattern
;;----------------------------
move p:(r6)+,x1 ;; pattern for x memory
move p:(r6)+,x0 ;; pattern for y memory
move p:(r6)+,y0 ;; pattern for p memory
;; write pattern to all memory locations
if (EQUALDATA) ;; x/y ram symmetrical
;; write x and y memory
clr a #start_dram,r0 ;; start of x/y ram
move #>length_dram,n0 ;; length of x/y ram