beautypg.com

Motorola DSP96002 User Manual

Page 589

background image

B-70

DSP96002 USER’S MANUAL

MOTOROLA

Bezier Cubic Evaluation

Program

ICycles

Words

move #Ptable+2,r0

move #2,n0

move #TK,r4

move x:(r0)-,d4.s 1 1

move x:(r4)+,d0.s y:,d5.s 1 1

fmpy d4,d0,d1 fsub.s d5,d0 x:(r0)-,d4.s d0.s,d5.s 1 1

fmpy.s d4,d0,d2 y:(r4)-,d4.s 1 1

fmpy d4,d5,d1 fsub.s d1,d2 1 1

fmpy.s d1,d2,d2 1 1

fmpy.s d0,d0,d1 x:(r0)+n0,d4.s 1 1

fmpy.s d1,d4,d1 d5.s,d4.s 1 1

fmpy d4,d4,d1 fsub.s d1,d2 1 1

fmpy.s d0,d2,d2 1 1

fmpy.s d1,d4,d1 x:(r0)+n0,d5.s 1 1

fmpy.s d1,d5,d1 1 1

fadd.s d1,d2 1 1

--- ---

Totals: 13 13

The result x(t) is in d2. The setup of the pointers is not included because this is application dependent and

does not have to be performed for each evaluation of x(t). The first two moves may also be application

dependent and be merged with other data ALU operations for a savings of two more cycles and program

steps.

Reference: "Fundamentals of Interactive Computer Graphics",

James D. Foley Andries Van Dam

Addison-Wesley 1982

B.1.38

Byte/16 Bit Packing/Unpacking From/To 32 Bits

B.1.38.1 Pack Four Bytes Into a 32 Bit Word

The following packs four 8 bit bytes into a single 32 bit word. The bytes to be packed are right justified in

four separate registers:

d0 = xxxA d2 = xxxC

d1 = xxxB d3 = xxxD