Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0084/sndmes.mac
There is 1 other file named sndmes.mac in the archive. Click here to see a list.
	TITLE SNDMES - SEND A MESSAGE TO ANOTHER COMPUTER


	P=	17		;THE STACK POINTER
				;THE COMMUNICATIONS ROUTINES REQUIRE
				; A STACK POINTER IN REGISTER 17.


SNDMES:	RESET
	MOVE	P,[IOWD PDLEN,PDLST] ;SETUP THE STACK
	MOVEI	16,INTBLK	;SETUP FOR LINE INIT.
	PUSHJ	P,INIT##	;INIT THE COMMUN. LINE
	SKIPN	IERROR		;ANY ERRORS ?
	JRST	INTERR		;YES, HANDLE IT
	MOVEI	16,SNDBLK	;SETUP FOR THE TRANSFER
	PUSHJ	P,SEND##	;SEND THE MESSAGE
	SKIPL	IERROR		;ANY ERRORS ?
	JRST	SNDERR		;YES, TELL USER
	OUTSTR	[ASCIZ/
    TRANSFER COMPLETE
/]
HANGUP:	PUSHJ	P,HNGUP##	;RELEASE THE LINE
	EXIT			;ALL FINISHED
;
;	HERE ON LINE INITIALIZATION ERRORS
;

INTERR:	OUTSTR	[ASCIZ/
? INIT ERROR - /]
	MOVE	ITYPE		;GET THE ERROR CODE
	SUBI	1		;MAKE IT 0 OR 1
	JUMPG	INT2		;ERROR CODE 2
	OUTSTR	[ASCIZ/TTY LINE NOT AVAILABLE
/]
	JRST	HANGUP		;GIVE UP

INT2:	OUTSTR	[ASCIZ/TTY NOT ASSIGNED TO THIS JOB
/]
	JRST	HANGUP		;GIVE UP




;
;	HERE ON TRANSMISSION ERRORS
;

SNDERR:	OUTSTR	[ASCIZ/
? TRANSMIT ERROR - /]
	SKIPG	ITYPE		;TEST THE ERROR CODE
	JRST	SND1
	OUTSTR	[ASCIZ/DATA MESSAGE RECEIVED
/]
	JRST	HANGUP		;GIVE UP

SND1:	OUTSTR	[ASCIZ/GAVE UP AFTER MANY RETRIES
/]
	JRST	HANGUP		;GIVE UP
;
;	STORAGE LOCATIONS FOR SNDMES
;
	PDLEN=	20
PDLST:	BLOCK	PDLEN

	XWD	-3,0		;ARGUMENT BLOCK FOR INIT
INTBLK:	XWD	100,IOINDX
	XWD	100,IERROR
	XWD	100,ITYPE

IOINDX:	EXP	200006		;UNIVERSAL I/O INDEX OF LNE 6
IERROR:	0
ITYPE:	0

	XWD	-4,0		;ARGUMENT BLOCK FOR DATA MESSAGE
SNDBLK:	XWD	640,LIT
	XWD	100,N
	XWD	100,IERROR
	XWD	100,ITYPE

ISEND:	EXP	"T","H","I","S",40,"I","S",40,"T","H","E",40
	EXP	"M","E","S","S","A","G","E",40,"S","E","N","T","."
NCHR=	.-ISEND
N:	EXP	NCHR
LIT:	POINT	36,ISEND,35
	XWD	0,NCHR


	END	SNDMES