Motorola DSP96002 User Manual

Page 592

Advertising
background image

MOTOROLA

DSP96002 USER’S MANUAL

B-73

B.1.40.1 32 Bit Block Transfer

32 Bit Block Transfer

Program

ICycles

BITBLT

Words

org x:0

source ds 1 ;source address

dest ds 1 ;destination address

offset ds 1 ;bit number start (0-31)

count ds 1 ;number of 32 bit source words

org p:$50

move x:offset,d0.l ;get output bit position 2 2

move #32,d1.l ;get 32 1 1

sub d0,d1 x:source,r0 ;32-offset, point to source 2 2

move x:dest,r1 ;point to destination address 2 2

move d1.l,d1.h ;move shift factor 1 1

move y:(r1),d4.l ;get first bits of dest 1 1

lsl d1,d4 d0.l,d0.h ;shift bits, move shift fact 1 1

move x:count,n0 ;get source word count 2 2

do n0,bitblt ;do transfer 2 3

lsr d1,d4 y:(r0)+,d5.l ;shift old bits, get source bits 1 1

lsl d0,d5 d5.l,d3.l ;shift new bits, save new bits 1 1

or d4,d5 d3.l,d4.l ;merge bits, save new as old bit 1 1

move d5.l,y:(r1)+ ;save new dest field 1 1

bitblt

lsr d1,d4 y:(r1),d5.l ;shift old bits, get dest bits 1 1

lsr d0,d5 ;shift dest bits 1 1

lsl d0,d5 ;shift dest bits back 1 1

or d4,d5 ;part of dest with source bits 1 1

move d5.l,y:(r1) ;save new destination bits 1 1

--- ---

Totals: 24 4N+20

Where N represents 32 bits transferred. At a 13.5 MIPS, a total of (13.5/4)*32 = 108 MBits/Second transfer
rate is possible.

Advertising