;***************************************************************************;
;									    ;
;				   HEADER				    ;
;		       clear screen and display header			    ;
;									    ;
;			  Author: David F. Pallmann			    ;
;	     Copyright (C) 1984 by LMS Technical Services, Inc.		    ;
;									    ;
;***************************************************************************;

OBJNAM	HEADER.SBR

VMAJOR=1

;universals
SEARCH	SYS
SEARCH	SYSSYM
SEARCH	TRM
SEARCH	STRUCT

.OFINI
.OFDEF	XC.ARG,2			;number of arguments
.OFDEF	XC.TY1,2			;type code - arg 1
.OFDEF	XC.AD1,4			;abs addr - arg 1
.OFDEF	XC.SZ1,4			;size - arg 1
.OFDEF	XC.TY2,2			;type code - arg 2
.OFDEF	XC.AD2,4			;abs addr - arg 2
.OFDEF	XC.SZ2,4			;size - arg 2
.OFSIZ	XC.SIZ

DEFINE	CURSOR	ROW,COL
	MOVW	ROW,D1
	ROLW	D1,#8.
	ADDW	COL,D1
	TCRT
	ENDM

START:	PHDR	-1,0,PH$REE!PH$REU	;program header
	MOVW	#-1_8.,D1
	TCRT				;CLEAR SCREEN
	MOVW	#-1_8.+12.,D1
	TCRT				;HIGH INTENSITY

LINE1:	CMMW	XC.ARG(A3),#1
	JLT	RETURN
	MOV	XC.SZ1(A3),D0
	SAVE	D0
	MOV	#80.,D1
	SUB	D0,D1
	BIT	#1,D1
	BEQ	10$
	INC	D1
10$:	ASR	D1
	AND	#377,D1
	ADD	#1_8.,D1
	TCRT
	MOV	XC.AD1(A3),A0
	REST	D0
20$:	MOVB	(A0)+,D1
	TTY
	SOB	D0,20$

LINE2:	CMMW	XC.ARG(A3),#2
	BLT	RETURN
	MOV	XC.SZ2(A3),D0
	SAVE	D0
	MOV	#80.,D1
	SUB	D0,D1
	BIT	#1,D1
	BEQ	10$
	INC	D1
10$:	ASR	D1
	AND	#377,D1
	ADD	#2_8.,D1
	TCRT
	MOV	XC.AD2(A3),A0
	REST	D0
20$:	MOVB	(A0)+,D1
	TTY
	SOB	D0,20$

RETURN:	CURSOR	#4,#1
	MOVW	#-1_8.+11.,D1
	TCRT				;LOW INTENSITY
	RTN

	END