blocky:		equ	5
*	*
*	*
*	  *
*	  *
*	  *
*
start:
	moveq	#0,d0
	moveq	#0,d1
	moveq	#11,d2
	moveq	#5,d3
	bsr	linedraw

linedraw:
	cmpi.w	#blocky,d2
	ble	ns1
	exg	d2,d3
	bra	ns2
ns1:
	exg	d2,d3

ns2:
	moveq 	#0,d7
	cmp.w 	d1,d3
	beq.s 	noline
	bge.s 	okdown
	exg 	d1,d3
	exg 	d0,d2
okdown:
	moveq 	#1,d6
	sub.w 	d1,d3		; dy
	sub.w 	d0,d2		; dx
	bge.s 	okright
	neg.w 	d2		;dx
	neg.w 	d6		;step
okright:
	asl.w	#2,d1
	lea 	coords,a0	;go to end of coords
	move.w 	d0,d7		;x1
	move.w 	d3,d0		;dy
	moveq	#0,d1
	moveq	#0,d4
	moveq	#0,d5
lineloop:
	move.w 	d7,(a0)+
	add.w 	d2,d5
test:
	cmp.w 	d3,d5
	blt.s 	noacross
	sub.w 	d3,d5
	add.w 	d6,d7
	bra.s 	test
noacross:
*	move.w 	d7,(a0)+
*	add.w 	d2,d5
	dbra 	d0,lineloop
noline:
	rts

coords:
	ds.w	100
