beautypg.com

Motorola DSP96002 User Manual

Page 600

background image

MOTOROLA

DSP96002 USER’S MANUAL

B-81

cmp d4,d2

dec d6 ifge

jsr _draw_point

_line_y_xn

rts

; Increment x case

; If dx is negative, switch endpoints and sign of dx and dy

_inc_x

tst d0

jeq _draw1

tfr d4,d6 iflt

tfr d5,d7 iflt

neg d0 iflt

neg d1 iflt

tst d1

jlt _set_x_yn

; Increment x, dy positive case

; Set up registers

_set_x_yp

lsr d0 d0.l,d2.l

dec d2 d2.l,d4.l

move d0.l,r0

move d2.l,m0

move d1.l,n0

move d1.l,d5.l

; Draw first point

jsr _draw_point

; Draw additional points

do d4.l,_line_x_yp

inc d6 r0,d2.l

add d5,d2 (r0)+n0

cmp d4,d2

inc d7 ifge

jsr _draw_point

_line_x_yp

rts

; Increment x, dy negative case

; Set up registers

_set_x_yn