Motorola DSP96002 User Manual page 587

32-bit digital signal processor
Table of Contents

Advertisement

3-D Graphics Illumination
move
move
move
fmpy.s d6,d7,d0
fmpy.s d6,d7,d1
fmpy
fmpy
fmpy.s d2,d0,d0
intrz
fmpy.s d6,d7,d0
move
fmpy
fadd.s d0,d1
fmpy.s d0,d1,d1
fadd.s d1,d2
fmpy.s d2,d0
fmpy.s d1,d2,d1
fadd.s d1,d0
The illumination value I is in d0.
Reference: "Fundamentals of Interactive Computer Graphics",
James D. Foley, Andries Van Dam
Addison-Wesley 1982
B.1.36
Pseudorandom Number Generation
This pseudorandom number generator requires a 32 bit seed and returns an unsigned 32 bit random num-
ber. There are no restrictions on the value of the seed. The equation for the seed is:
seed = (69069 * seed + 1) mod 2 ** 32
Pseudorandom Number Generation
move
move
mpyu
inc
move
B-68
d6,d7,d1 fadd.s d1,d0 x:(r0)+,d6.s y:,d7.s
d6,d7,d1 fadd.s d1,d0 x:(r4)+,d2.s
d0
d6,d7,d0 fadd.s d0,d1 x:(r1+n1),d2.s
x:seed,d0.l
#69069,d1.l
d0,d1,d0
d0
d0.l,x:seed
DSP96002 USER'S MANUAL
#vec,r0
#ktbl,r4
x:(r0)+,d6.s y:,d7.s
x:(r0)+,d6.s y:,d7.s
x:(r0)+,d6.s y:,d7.s
x:(r4)+,n1
x:(r0)+,d6.s y:,d7.s
d0.l,r1
x:(r0)+,d6.s y:,d7.s
x:(r4)+,d0.s
x:(r4)+,d0.s
x:(r4)+,d1.s
x:(r4),d2.s
Totals: 20
;get seed
;get constant
;multiply
; +1
;mod 2 ** 32, new seed 2
Totals:
Program
ICycles
Words
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
---
---
21
Program
ICycles
Words
2
2
2
2
1
1
1
1
2
---
---
8
8
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents