perm filename HEDTST[S,AIL] blob sn#072707 filedate 1973-11-18 generic text, type T, neo UTF8
;  TELETYPE COMMUNICATION MACROS

DEFINE OP1 &(OPR,MS,ACC)  <
	IFIDN <ACC><>, <II←←0>
	IFDIF <ACC><>, <II←←ACC>
	OPR&. II,[ASCIZ /MS/]
>

DSCR IOERR (STR)
CAL MACRO
PAR ASCII string to be printed
RES calls IOERR. UUO to print message, either restart
 compiler or EXIT
⊗

DSCR ERR (STR,CODE,ROUT)
CAL MACRO -- calls ERR. UUO
PAR STR ASCII string to be printed
 CODE determines how UUO functions
 ROUT is address or literal to jump to if ERR continues
RES If SAIL is on DPY, displays input line
 Prints STR
 CODE%2 determines what else to print -- if CODE is:
  0-1:  Print nothing more
  2-3:  Ident name for Semantics in LPSA (SAIL only)
  4-5:  Ident name for Semantics in UUO instr (SAIL only)
  6-7:  Value of AC in AC field of instr preceding UUO
 10-11: The UUO in octal
 12-13: Value of AC field of instr preceding that indicated
        by UUO1(GOGTAB)

 If CODE is even, don't allow continuation -- otherwise
  allow continuation in manner described by error message.
 If ROUT is present, jump to it -- else continue in line
⊗
FOR OP ⊂ (ERR,IOERR) <
DEFINE OP (MSG,AC,ADDR) <
	IFIDN	<ADDR><>,<OP1 (OP,<MSG>,AC)>
	IFDIF <ADDR><>,<JRST	[OP1 (OP,<MSG>,AC)
			   JRST	ADDR ]>
>>

DSCR CORERR
CAL MACR
PAR	message
RES	Types the message, then exits the program 
SID none
⊗
DEFINE CORERR(MSG) < JRST [	PUUO	3,[ASCIZ /MSG
/]
				CALL6   EXIT		]>

DSCR PRINT, TERPRI (STR)
CAL MACRO -- calls prin.. uuo.  
PAR Ascii message
RES Types string -- types CRLF after if TERPRI -- ERRPRI sends to log file if
user is enabled for that.
SID none
⊗
DEFINE ERRPRI (X) <
	PUSH	P,A
	MOVEI	A,[ASCIZ /X
/]
	PUSHJ	P,PRINT.
	POP	P,A
>

DEFINE PRINT (X) <
	PUUO 3,[ASCIZ /X/]
>

DEFINE TERPRI (X) <
	PUUO	3,[ASCIZ /X
/]>

DEFINE SPRINT(X) <	;SAFE PRINT, BEFORE UUO SET UP
	TTCALL 	3,[ASCIZ /X/]
>