blocky:		equ	5
*	*
*	*
*	  *
*	  *
*	  *
*
start:
	moveq	#0,d0
	moveq	#0,d1
	moveq	#10,d2
	moveq	#5,d3
	bsr	linedraw
	nop
	nop

linedraw:
	moveq 	#0,d7
	cmp.w 	d1,d3
	beq.s 	noline
	bge.s 	okdown
	exg 	d1,d3
	exg 	d0,d2
okdown:
	move.w	d1,d4
	moveq 	#1,d6
	sub.w 	d1,d3		; dy
	sub.w 	d0,d2		; dx
	bge.s 	okright
	neg.w 	d2
	neg.w 	d6
okright:
*	asl.w	#2,d1
	lea 	coords,a0
*	adda.w 	d1,a0
	move.w 	d0,d7		;x1
*	add.w 	d7,d7		;x1*2
	move.w 	d3,d0		;dy
	moveq	#0,d1
*	moveq	#0,d4
	moveq	#0,d5
lineloop:
	move.w 	d7,(a0)+
	move.w	d1,(a0)+
	addq.w	#1,d1
	add.w 	d2,d5
test:
	cmp.w 	d3,d5
	blt.s 	noacross
	sub.w 	d3,d5
	add.w 	d6,d7
	bra.s 	test
noacross:
	dbra 	d0,lineloop
noline:
	rts



coords:
	ds.w	1000
