Google
 

Trailing-Edge - PDP-10 Archives - steco_19840320_1er_E35 - 10,5676/teco/source/tecdtm.mac
There are 3 other files named tecdtm.mac in the archive. Click here to see a list.
	SUBTTL	Introduction

; Copyright (c) 1980 Stevens Institute of Technology, Hoboken, New Jersey
; 07030.

; This software may be used and copied provided that this copyright notice
;is included, and provided that copies of all modifications are sent to:
;
;	TECO Project
;	Computer Center
;	Stevens Institute of Technology
;	Castle Point Station
;	Hoboken, New Jersey    07030
;
;
; The information in this software is subject to change without notice
; and should not be construed as a commitment by Stevens Institute of
; Technology.

  ; Search needed universals

	SEARCH	TECUNV		; TECO universal file

  ; Generate the prologue


	TECVER==200		; Major version number
	TECMIN==1		; Minor version number
	TECEDT==1126		; Edit level
	TECWHO==0		; Last editor


	PROLOGUE(DTM,<TECO Datamedia terminal support>)	; Generate the TITLE and other stuff

	$CODE			; Put into code PSECT
	SUBTTL	Table of Contents

;+
;.pag.lit

;		Table of Contents for TECDTM - Datamedia terminal support
;
;
;			   Section			      Page
;   1. Introduction . . . . . . . . . . . . . . . . . . . . .    1
;   2. Table of Contents. . . . . . . . . . . . . . . . . . .    2
;   3. Revision History . . . . . . . . . . . . . . . . . . .    3
;   4. Tables
;        4.1.   Datamedia-1520/1520A. . . . . . . . . . . . .    5
;   5. Support routines
;        5.1.   DM-1520A
;             5.1.1.     XY positioning . . . . . . . . . . .    6
;             5.1.2.     Move cost calculation. . . . . . . .    7
;             5.1.3.     Delete a line feed . . . . . . . . .    8
;             5.1.4.     Control-U. . . . . . . . . . . . . .    9
;             5.1.5.     Delete to end of line. . . . . . . .   10
;   6. Low segment. . . . . . . . . . . . . . . . . . . . . .   11
;   7. End of TECDTM. . . . . . . . . . . . . . . . . . . . .   12

;.end lit.pag
;-
	SUBTTL	Revision History
COMMENT	|

1000	Start of this version

Start of Version 200A(1126)
|
; Macro to define a word of five characters

	DEFINE	TB(A<.CHNUL>,B<.CHNUL>,C<.CHNUL>,D<.CHNUL>,E<.CHNUL>)
<	BYTE	(7)A,B,C,D,E>
	SUBTTL	Tables -- Datamedia-1520/1520A

CRTINI	V1520
	CRTENT	DBS,<TB(" ",.CHCNH)>
	CRTENT	CRB,<TB(.CHCNH)>
	CRTENT	CTU,<PUSHJ P,D15CTU>	; Routine to process a control U
	CRTENT	BCK,<TB(.CHCNH)>
	CRTENT	DLF,<PUSHJ P,D15DLF>	; Routine to delete a line feed
	CRTENT	SPC,<TB(" ")>
	CRTENT	ERS,<TB(.CHFFD)>
	CRTENT	DEL,<PUSHJ P,D15DEL>	; Routine to delete a line
	CRTENT	DSP,.CHSPC
	CRTENT	(LIN,^D24)
	CRTENT	(WID,^D79)
	CRTENT	XYP,<PUSHJ P,D15XY>	; X and Y positioning
	CRTENT	CPP,<PUSHJ P,D15CPP>	; Cost to move from point A to B
	CRTENT	CDE,<MOVEI T1,1>	; Cost to delete to end of line
CRTEND			; End the table
	SUBTTL	Support routines -- DM-1520A -- XY positioning

;+
;.HL D15XY
;This routine will do the positioning for the Datamedia-1520 terminal.
;.literal
;
; Usage:
;	MOVE	X,X.postion
;	MOVE	Y,Y.postion
;	MOVE	CRT,CRT.block.index
;	PUSHJ	P,@$CRXYP(CRT)
;	(Return)
;
;.end literal
;-

D15XY:	$SAVE	<CH>		; Save the character
	DMOVE	T1,CURPOS	; Get the current position
	DMOVEM	X,CURPOS	; Save the current position
	SUB	T1+$OFSX,X	; Determine if it is an up/down/right/left by one
	SUB	T1+$OFSY,Y	;  movement
	SKIPE	T1+$OFSX	; Is the X zero ?
	 SKIPN	T1+$OFSY	; Or the Y ?
	  SKIPA			; Yes - Handle differently
	JRST	D15XYA		; No - Handle normally
	SKIPN	T1+$OFSY	; No change in the Y offset ?
	 JUMPE	X,D15XYC	; Yes - Only need a CR
	MOVM	T3,T1+$OFSX	; Get the X offset
	SOJE	T3,D15XYX	; Just X by one
	MOVM	T3,T1+$OFSY	; Get the Y offset
	SOJE	T3,D15XYY	; Just the Y by one
D15XYA:	SKIPN	X		; Is this non-zero ?
	 JUMPE	Y,D15XYH	; Just home it
	ADDX	X," "		; Convert to a position
	ADDX	Y," "		; Convert to a position
	MOVEI	T1,[$STRING(<_^^8/X/^8/Y/>)]
	PJRST	SC$STR		; Output the string

; Here to just home the cursor

D15XYH:	$SAVE	<CH>		; Save CH
	MOVX	CH,.CHCNY	; Get the character to send
	PJRST	SC$IMG		; Output the character

; Here to just output a CR

D15XYC:	MOVX	CH,.CHCRT	; Just output a CR
	PJRST	SC$IMG		; . . .

; Here to move in the X direction by one

D15XYX:	SKIPGE	T1+$OFSX	; Is this negative ?
	 SKIPA	CH,[EXP .CHCBS]	; Get the charater to move right
	  MOVX	CH,.CHCNH	; Character to move left
	PJRST	SC$IMG		; Output the character

; Here to move in the Y direction by one

D15XYY:	SKIPL	T1+$OFSY	; Is this negative ?
	 SKIPA	CH,[EXP .CHCUN]	; Get the character
	  MOVX	CH,.CHLFD	; To move down
	PJRST	SC$IMG		; Move the cursor up or down
	SUBTTL	Support routines -- DM-1520A -- Move cost calculation

;+
;.hl 1 D15CPP
; This routine will return the cost of moving the cursor from
;one point to another.
;.b.lit
;
; Usage:
;	MOVE	T1,[XWD X pos,Y pos] ; Source position
;	MOVE	X,[-n,,Column]
;	MOVE	Y,[-n,,Row]
;	MOVE	CRT,CRTTYP
;	XCT	$CRCPP(CRT)
;	 (return, T1= cost in characters)
;
;.end literal
;-

D15CPP:	MOVE	T3,T2		; Get a copy of where we are moving to
	XOR	T3,T1		; Xor together
	JUMPE	T3,.RET0	; Return a zero if not moving
	TXNN	T3,LH.ALF	; Same X position line ?
	 JRST	D15CPY		; Yes - Check more
	TXNN	T3,RH.ALF	; Same Y position ?
	 JRST	D15CPX		; Yes - Check more
	JUMPE	T1,.RET2	; If moving home return cost of one
D15CPA:	MOVX	T1,3		; Have to type three characters
	POPJ	P,		; Return

; Here if possible same column movement

D15CPY:	MOVEI	T2,(T2)		; Get just the Y position
	SUBI	T2,(T1)		; Determine if just one line movement
	MOVM	T1,T2		; . . .
	SOJG	T1,D15CPA	; More than one - use three
	JRST	.RET1		; Else return one

; Here if possible same line movement

D15CPX:	HLRZ	T2,T2		; Get just the X position
	JUMPE	T2,.RET1	; If moving to the beginning of the line
				;  then return one
	HLRZ	T1,T1		; See if moving only one position
	SUBI	T1,T2		; . . .
	MOVM	T2,T1		; Get the magntude
	SOJG	T2,D15CPA	; If more than one - return three
	JRST	.RET1		; Else return one
	SUBTTL	Support routines -- DM-1520A -- Delete a line feed

;+
;.HL1 D15DLF
;This routine will send the character string to delete a line feed.
;.literal
;
; Usage:
;	MOVE	CRT,CRT.block.address
;	PUSHJ	P,@$CRDLF(CRT)
;	(Return)
;.end literal
;-

D15DLF:	MOVX	CH,.CHCUN	; Get the character to send
	PJRST	SC$IMG		; Output it
	SUBTTL	Support routines -- DM-1520A -- Control-U

;+
;.HL1 D15CTU
;This routine will process the control U in the command parser.  It
;may be called without CRT being set up.
;.literal
;
; Usage:
;	MOVE	CRT,CRT.block.address
;	PUSHJ	P,@$CRCTU(CRT)
;	(Return)
;
;.end literal
;-


D15CTU:	MOVX	T1,<BYTE(7).CHCRT,.CHCRB> ; Get the characters
	PUSHJ	P,SC$STR	; Output the string
	MOVX	CH,.CHCRT	; Get the single character
	PJRST	T$OCHR		; And type it
	SUBTTL Support routines -- DM-1520A -- Delete to end of line

;+
;.hl1 D15DEL
;This routine will delete to the end of the current line.
;.literal
;
; Usage:
;	MOVEI	T1,# of characters to delete
;	XCT	$CRDEL(CRT)
;
;.end literal
;-

D15DEL:	MOVX	T1,<BYTE (7).CHCRB>
	PJRST	SC$STR

	SUBTTL	Low segment

	$IMPURE			; Put in correct place

DTMBEG:!

	LOWVER(DTM,<.-DTMBEG>); Define the version number
	SUBTTL	End of TECDTM

	END			; End of TECDTM