DATASEG	SEGMENT	DATA
	RSEG	DATASEG                      

	PUBLIC  dcntl
	PUBLIC	dcnth

dcntl:	DS	1
dcnth:	DS 	1

CODESEG SEGMENT CODE
        RSEG    CODESEG

        PUBLIC  DEMO


        EXTRN   CODE (DEMODATA)
        EXTRN   CODE (DEMODATASIZE)
	EXTRN	CODE (LINE)

        EXTRN   DATA (X1ABS)
        EXTRN   DATA (Y1ABS)
        EXTRN   DATA (X2ABS)
        EXTRN   DATA (Y2ABS)

DEMO:	

	mov 	dptr,#demodatasize
	clr	a
	movc 	a,@a+dptr
	mov	dcntl,a
	inc	dptr
	clr	a
	movc	a,@a+dptr
	mov	dcnth,a
	mov	dptr,#(demodata-1)
demo1:	
	call	getnext
	mov	x1abs,a
	call	getnext
	mov	x1abs+1,a
	
	call	getnext
	mov	y1abs,a
	call	getnext
	mov	y1abs+1,a

	call	getnext
	mov	x2abs,a
	call	getnext
	mov	x2abs+1,a

	call	getnext
	mov	y2abs,a
	call	getnext
	mov	y2abs+1,a

	push	dph
	push	dpl
	push	dcnth
	push	dcntl

	call 	line

	pop	dcntl
	pop	dcnth
	pop	dpl
	pop	dph

	jmp demo1

	ret


getnext:
	clr	c
	mov	a,dcntl
	clr	a
	subb	a,#1
	mov	dcntl,a
	mov	a,dcnth
	subb	a,#0
	mov	dcnth,a

	inc	dptr
	clr	a
	movc	a,@a+dptr

	ret


        END