Motorola DSP96002 User Manual page 582

32-bit digital signal processor
Table of Contents

Advertisement

If the A bit is set, the line can be accepted. If the R bit is cleared, the line can be rejected.
B.1.33.4
Four Point Polygon Accept/Reject
This determines if the polygon consisting of the points (x0,y0,z0), (x1,y1,z1), (x2,y2,z2), (x3,y3,z3) is within
a three-dimensional view cube. If the polygon is within the cube, the A (accept) bit of the CCR will be set.
If the polygon is entirely outside of the cube, then the R bit will be cleared. If the polygon can not be ac-
cepted or rejected, then further processing is required to clip the polygon.
Registers:
d0 = dimension d4 = unused
d1 = limit
d2 = unused
d3 = unused
Memory Map:
(n0=3)
ori
#$e0,ccr
move
fcmp
d1,d0
fcmp
d1,d0
fcmp
d1,d0
fcmpg d1,d0
fcmp
d0,d1
fcmp
d0,d1
fcmp
d0,d1
fcmpg d0,d1
fcmp
d1,d0
fcmp
d1,d0
fcmp
d1,d0
fcmpg d1,d0
fcmp
d0,d1
fcmp
d0,d1
MOTOROLA
d5 = unused
d6 = unused
d7 = unused
X Memory
Y Memory
r0
x0
Xmin
y0
Xmax
z0
Ymin
x1
Ymax
y1
Zmin
z1
Zmax
x2
y2
z2
x3
y3
z3
Polygon Accept/Reject
;set accept/reject/overflow bits
x:(r0)+n0,d0.s y:(r4)+,d1.s ;get x0,Xmin
x:(r0)+n0,d0.s
x:(r0)+n0,d0.s
x:(r0)-n0,d0.s
x:(r0)-n0,d0.s
x:(r0)-n0,d0.s
x:(r0)+,d0.s
x:(r0)+n0,d0.s y:(r4)+,d1.s ;Xmax-x0, y0,Ymin 1
x:(r0)+n0,d0.s
x:(r0)+n0,d0.s
x:(r0)-n0,d0.s
x:(r0)-n0,d0.s
x:(r0)-n0,d0.s
DSP96002 USER'S MANUAL
r4
;x0-Xmin, get x1
;x1-Xmin, get x2
;x2-Xmin, get x3
y:(r4)+,d1.s ;x3-Xmin, Xmax
;Xmax-x3, get x2
;Xmax-x2, get x1
;Xmax-x1, get x0
;y0-Ymin, get y1
;y1-Ymin, get y2
;y2-Ymin, get y3
y:(r4)+,d1.s ;y3-Ymin, ymax
;Ymax-y3, get y2
;Ymax-y2, get y1
Program
ICycles
Words
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
B-63

Advertisement

Table of Contents
loading

Table of Contents