Skip to main content

Full text of "dec :: pdp11 :: tsxPlus :: listings :: 6.40 :: 08 03 tsem2 19890118"

See other formats


TSEM2 TSX-Plus EMT Overlay 
Table of contents 



MACRO V05. 05 Wednesday 18-Jan-89 10: 37 



2- 
4- 
5- 
6- 
7- 
8- 
9- 
10- 
10- 
11- 
12- 
12- 
12- 
12- 
12- 
13- 
14- 
14- 
15- 
15- 
16- 
17- 
18- 
19- 
20- 
21- 
21- 
21- 
22- 
23- 
24- 
26- 
26- 
27- 
29- 
30- 
32- 
33- 
34- 
35- 
36- 
37- 
38- 
40- 
40- 
41- 
43- 
44- 

46- 
47- 
48- 
49- 

50- 
51- 
52- 
53- 
54- 



1 

20 
36 
45 



17 



13 

23 



59 



39 



Branch vector for processing routines 

EMT entry processing 

Shared file control EMT's 

PLAS EMT's 

Message communication EMT's 

. WRITE 

. READ 

. SERR 

. HERR 

. SPFUN 

. SCCA 

. TRPSET 

. SFPA 

. QSET 

. SETTOP 

. GTJB 

. CHAIN 

. RCTRLO 

. HRESET 

. SRESET 

. SAVESTATUS 

. REOPEN 

. PURGE 

. CLOSZ 

. WAIT 

. GTIM 

. DATE 

. SDTTM 

. TWAIT 

. MRKT 

. CMKT 

. CSTAT 

. CDFN 

. GVAL 

. EXIT 

TTEMT 

SNDMSG 

GTMSBF 

QMSG 

ASTXIT 

. SPCPS 

EMT376 

JBINFO 



— Terminal control EMT 

— Send a message to a line 

— Get free system message buffer 

— Queue a message for a job 

— Exit from completion routine 

— Alter exit address from a completion routine 

— EMT 376 Processing 

— Get information about a specific job 
Get terminal type code 

Get Project-Programmer number 

MISC. TSX EMT'S 

Return system (swap) file specification 

Set transmit/receive speed for a line 

Access TSX system tables 

Get or set user name 

Request operator privilege 

Establish Break key sentinal control 

CHKTT — CHECK I/O TO TT DEVICE 

CKIOST — See if scheduler wants to stop I/O 

SETQ — Do setup of I/O queue element 

SETCR — Set completion routine address in queue element 

CVTUAD — Convert user address to physical address 



i 



c 
t 



( 



( 



T5EM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-B9 10:37 
Table of contents 

55- 1 LDIO — Process I/O to logical disks 

57- 1 INDIO — Perform I/O for IND data segment 

58- 1 EMTTRC — Trace EMT execution 

59- 1 PRTOCT — Print an octal value 



€ 

< 

i 
t 

€ 
€ 

i 
i 
i 
i 
€ 
i 



tsem; 



TSX-Plus EMT Overlay 



i 

2 

3 

4 

5 

6 

7 

S 

9 

10 

11 

12 

13 

14 

15 

16 

17 

18 

19 

20 

21 

22 

23 

24 

25 

26 

27 

28 

29 

30 

31 

33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 



000000 
000000 



020550 
177776 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 1 



. TITLE TSEM2 TSX-Plus EMT Overlay 

. ENABL LC 

. ENABL AMA 

. DSABL GBL 

Copyright <C> 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 
1986, 1987, 1988, 1989. 

S&H Computer Systems, Inc. 
Nashville, Tennessee 

This software is furnished under a license for use only 
on a single computer system and may be copied only with 
the inclusion of the above copyright notice. This 
software, or any other copies thereof, may not be provided 
or otherwise made available to any other person except 
for use on such system and to one who agrees to these 
license terms. Title to and ownership of the software 
shall at all times remain with S&H Computer Systems, Inc. 



TSEM2: 
PS 



. CSECT TSEM2 
. RAD50 /EM2/ 
177776 



i Overlay id 

> Processor Status Word 



Macros to enable and disable interrupts. 



; ENABLE INTERRUPTS 



. MACRO DISABL ; DISABLE INTERRUPTS 

BIS #340, @#PS 
. ENDM DISABL. 

. MACRO ENABL 

BIC INTPRI,@#PS 

. ENDM ENABL 

Macro to print an error message when a system crash occurs. 

Arguments: 
MSG - Name of error message to print. 
ARG = (Optional) argument value to display with error message. 

. GLOBL DIEMSG, DIEARG, SYSHLT 
. MACRO DIE MSG, ARG 

MSG, S#DIEMSG 

NB, ARG 

ARG, @#DIEARC 



MOV 
. IF 
MOV 
. ENDC 
CALL 
. ENDM 



@#SYSHLT 
DIE 



Macro definition for calling global routines residing in mapped 
system regions. 

. MACRO OCALL ENTADD 
.IF B, ENTADD 

.ERROR ; OCALL SPECIFIED WITH NO ENTRY ADDRESS 

. MEXIT 



< 



c 

< 
< 

i 
i 

< 

i 
i 

€ 

< 
i 

€ 

4 

i 
< 
( 



( 



i 



TSEM2 TSX-Plus EMT Overlay 



MACRO V05. 05 Wednesday 18-Jan--89 10:37 Page 1-1 



58 

59 

60 

61 

62 

63 

64 

65 

66 

67 

68 

69 

70 

71 

72 

73 

74 

75 

76 

77 

78 

79 

80 

81 

82 

83 

84 

85 

86 

87 

88 

89 

90 

91 

92 

93 

94 

95 

96 

97 

98 

99 

100 

101 

102 

103 

104 

105 

106 

107 

108 

109 

110 

111 

112 

113 

114 



. ENDC 
CALL 
. WORD 
. ENDM 



OVRHC 
ENTADD 



;CALL THE OVERLAY HANDLER 
; SPECIFY THE ENTRY POINT 



Macro calls 

. MCALL . PURGE, . TTYOUT 

Global definitions 

. GLOBL E375MX , EMT376, RT 1 1 EX 

. GLOBL TSEM2, READ, WRITE, DOEMT 

. GLOBL CINFLG, SDCLOS, UACHKW, GETQ 

. GLOBL QIO, GETUCH 

. GLOBL QFREE, SPLEM1 

. GLOBL IOWAIT, CANMKT 

. GLOBL SETERR, EMTXIT 

. GLOBL BADEMT 

. GLOBL KMNEMT 

. GLOBL DETEMT, PMEMT 

. GLOBL SSEMT 

. GLOBL QMSG 

Global references 

. GLOBL FRECXT, *CFOPN, GTLICN, CLEMT 

. GLOBL *VNOTT, SPPRED, *CTRLS, LDMEMT, GETCXT, REDCXT, CXTBUF 

. GLOBL *DETCH, RUNDEV, «. PA6, KPAR6, STTCPL, TSXVRS, VLSEMT 

. GLOBL DELETE, LOOKUP, ENTER, RENAME, RTDEV, SFDATE, SFPROT 

. GLOBL RTSPND, RTRSUM, ABTIO, XHIOUT, XHI IN, XTERCK, XRDTIM 

. GLOBL XHISET, MOUNT, DISMNT, RTEMT, GFINFO, SFTIME, SETPRI 

. GLOBL ALCEMT, MONEMT, CPYEMT, TTYIN, TTYOUT, DSTAT, FETCH 

. GLOBL CSIGEN, CSISPC, PRINT, CHKUSP, EMTASP, EMTSP, EMT ASP 

. GLOBL *EMTTR, PO$DBG, NLCHN, DOCOPN, DOOPAP, DOCULK, DORLK 

. GLOBL DOTLK, D0ULK1 , DOSFCK, VMXSF, P2*RLK, VMXWIN, EMTWIN, EMTPLS 

. GLOBL MSEND, MSGCK, MSGWT, P2*MSG 

. GLOBL PO*OPR, PO$SYS, P2*TRM, PO*NAM 

. GLOBL PR I VC2, PO*SND, PO*SPF, POSBYP 

. GLOBL TSXSIT, DS*SFN, SVIRJB, VIMAGE, PO$SPV 

. GLOBL LDPDEV, LDSIZE, LDBASE, Q. DEVX, LDFLAG, LD*RON, LDVERS 

. GLOBL CQ*LNK, CQ*RTN, CQ*PA5» CQ*JOB, CQ*RO, VPLAS, CFPNT 

. GLOBL INTPRI, UPPN, VPAR6, NFRESB, NSPLBL, LACTIV, SFCB, SFCBND 

. GLOBL SYTIMH, SYTIML, SYSDAT, SETSPD, VMAXMC, MSGABT, MONABT 

. GLOBL PNAME, MAXGVL, NUCHN, ABRTCD, ABRTAD 

. GLOBL EMTBLK, LSW2, *CCLRN, EMTPS, PRIVCO 

. GLOBL LSW4, LSW5, *INKMN, VALADW, VALADB, SPRGLK 

. GLOBL LPROJ, LPROG, IOHALT, EMTADR, MAXLD, LDNAME 

. GLOBL SERFLG, UTRPAD, LUNAME, UCLBLK, LPARNT 

. GLOBL LSW, *CTRLO, STOP, EXCJOB, CUREMT, DH**LB 

. GLOBL RPAR, RPDR, RDAR, RDDR, ODTBAS, CLRDIR, PVSPBL 

. GLOBL CQ*FLG, QF*IOT, DX*EBA, DVFLAG, WRITTT 

. GLOBL CS*RON, DS*RON, *INDRN, DS*DIR, CFLAG, SFWRIT 

. GLOBL SDMOVE, FAKCMP, TTREAD, DS*WON, DCRD1, INTERR, NUMDCD 

. GLOBL DCRD2, Q. CHAN, Q. CSW, Q. JOB, UACHKB, Q. BUFF, Q. JNUM 

. GLOBL Q. PAR, LDDEVX, G. COMP, Q. PAS, CXTBAS, KMNBAS 

. GLOBL S*TWFN, S*OTLO, S*QMIO, S*QCCB, S*QSPD, S*TTSC 



TSEM* 



TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jar>-89 10:37 Page 1-2 



115 

116 

117 

118 

119 

120 

121 

122 

123 

124 

125 

126 

127 

128 

129 

130 

131 

132 

133 

134 

135 

136 

137 

138 

139 

140 

141 

142 

143 

144 

145 

146 

147 

148 

149 

150 

151 

152 

153 

154 

155 

156 

157 

158 

159 

160 

161 

162 

163 

164 

165 

166 

167 

168 

169 

170 

171 



. GLOBL S*TTFN, S$HICP, S$RT, S*WFM, S*LOW, LPARBS, VPAR5 

. GLOBL LSTHL 

. GLOBL SCHED 

. GLOBL R*CHN, CHNSIZ, R*XCHN, Q. ICSW, Q. UCSW 

. GLOBL *FORM, CQ$CP, CP*STD 

. GLOBL RF*WRT, LSW6, tjsDBGMD 

. GLOBL EMTMAP, CHNNUM, LJSW, LSTHL 

. GLOBL CLOSE, CLZERR 

. GLOBL INDDBL, INDDBS, R*INTC, SINDDW 

. GLOBL LSW3, LSLEPH, LSLEPL 

. GLOBL PASLIN, SCHAIN, LSPND 

. GLOBL CHNADR, EMTCAD, EMTRAD, LSW3 

. GLOBL CORUSR, CURCP, SPCPS, *CTRLO, EMTCAS 

. GLOBL CXTRMN, UFPTRP, JCDB, *HARD, *DEAD, CFACFL, R*CFST 

. GLOBL VTSLCH, LBRKCQ, LBRKCH, SYNAME, IOABFL 

. GLOBL MX JPR I , LPR I , LBSPR I , CQ*RNS, CQ*PR I 

. GLOBL ABORT, VSWPFL, VPRIDF, VPRILO, VPRIHI 

, GLOBL *ODTMD, LSCCA, MXJADR, FPUUSE, CW*FPU 

, GLOBL PO*MEM, LSW2S, LIOHLD, LIOCNT 

GLOBL MAXPRI,LITIME, $NOINT 

GLOBL URO, CHKABT, NSPLDV 

GLOBL S*NEDQ, DVSTAT 

GLOBL JSWLOC, SUTOP, TTOPTS 

GLOBL SFSVST, *TTGAG, 5B*TXT, SB*END 

GLOBL NMUMB, SNMSHD, GtNSPND, SB*LNK, SB*PNT 

GLOBL LNPRIM, LMSGBF, TRNSTR, LNMAP, MAXSEC, LSECPT 

GLOBL EMTERR, LSTATE, S*IOWT, UMODE 

GLOBL CS*ERR, CS*NMX> CS*ENT 

GLOBL CS*EOF, CSSQPN, CS*NMX, DS*NRD 

GLOBL C. CSW, C. USED, Q. WCNT, CINDAT, SFCLS 

GLOBL C. NUMQ, Q. BLKN, 0. FUNC 

GLOBL C. DEVQ, Q. UNIT 

GLOBL C. SBLK, C. LENG 

GLOBL UCHAN, CSIARE, OVLBIT 

GLOBL LBASE, CS$SPL, SFRSST 

GLOBL RMNBAS 

GLOBL S*WSMB 

GLOBL LSTPL, *DILUP 

GLOBL LCONTM, LSW9 

GLOBL 5*I0FN, LSW7, SSOTFN 

GLOBL S*TMWT 

GLOBL QHDSPN, NUMDEV 

GLOBL MRKTHD, CQSHOT, CQ*LOT 

GLOBL LSTDL 

GLOBL R*CHN, R4DATE 

GLOBL LEMTPC,LSW11,*V52EM, *UDSPC 

GLOBL VT52, VT100, HAZEL, ADM3A, LA36, LAI 20 

GLOBL DIABLO, QUME, LTRMTP, VT2007, VT2008 

GLOBL $FORM 

GLOBL *IOMAP 

GLOBL CONFIG, LNSBLK 

GLOBL JIVLN, JIDLN, JIMLOK, JIPRIV 

GLOBL LSTSL, *KINIT, *MLOCK, LNBLKS, MINTIM 

GLOBL LPRG1,LPRG2, LCPUHI, LCPULO 

GLOBL S*INWT, S*OTWT, S*SPND, S*SFWT, S*MSWT 

GLOBL S*QUSR, SSSFWT, S$SPDB, SSSPCB 

GLOBL S*CPU 



« 
C 

I 
< 

< 
i 
< 



( 



< 



TSEM2 TSX-Plus EliT Overlay 



MACRO V05. 05 Wednesday 18-Jan-S9 10:37 Page 1-3 



172 




173 




174 




175 




176 




177 




178 




179 




180 




181 




182 




183 




184 




185 




186 


000000 


187 


000001 


188 


000002 


189 


000003 


190 


000004 


191 





. GLOBL 
. GLOBL 
. GLOBL 
. GLOBL 
. GLOBL 
. GLOBL 
. GLOBL 
. GLOBL 
. GLOBL 
Glob a Is used 
. GLOBL 



SETC 

MAXCC 

CSIARE 

RC*BA5 

SETRBF, CMDB, CMDC, GTSPAC, CMDE, CMDF, CMDG, CMDH 

CMDI, CMDJ, CMDK, CMDL, CMDM, CMDN, CMDO, RSSPAC, SFWAC 

CMDR, CMDS, CMDT, CMDU, SFWL, CMDW, CMDX, CMDY, CMDZ 

SWDBLK, SPLBLK, RSFBLK, UCLDAT, INDFIL 

GETDSS, SETDSS, MS*DTR 

for system mapped regions 

OVRHC 



EMT error code definitions 

ECO = 

EC1 - 1 

EC2 = 2 

EC3 = 3 

EC4 = 4 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 
Branch vector for processing routines 



Wednesday 18-Jan-89 10:37 Page 



1 

2 






3 






4 

5 






6 






7 






e 


000002 


OOOOOOG 


9 


000004 


OOOOOOG 


10 


000006 


OOOOOOG 


11 


000010 


002762 ' 


12 


000012 


OOOOOOG 


13 


000014 


003520 ' 


14 


000016 


003644 ' 


15 


000020 


OOOOOOG 


16 


000022 


001674" 


17 


000024 


001106' 


18 


000026 


004236 ' 


19 


000030 


OOOOOOG 


20 


000032 


OOOOOOG 


21 


000034 


005332' 


22 


000036 


000554' 


23 


000040 


OOOOOOG 


24 


000042 


003254 ' 


25 


000044 


004316' 


26 


000046 


004542' 


27 


000050 


004702 ' 


28 


000052 


004456' 


29 


000054 


OOOOOOG 


30 


000056 


OOOOOOG 


31 


000060 


005170' 


32 


000062 


003002 ' 


33 


000064 


OOOOOOG 


34 


000066 


002452' 


35 


000070 


OOOOOOG 


36 


000072 


005344' 


37 


000074 


002736 ' 


38 


000076 


000750' 


39 


000100 


OOOOOOG 


40 


000102 


004370 ' 


41 


000104 


007202 ' 


42 


000106 


OOOOOOG 


43 


000110 


OOOOOOG 


44 


000112 


OOOOOOG 


45 


000114 


004142' 


46 




000046 


47 






48 






49 


000116 


004236 ' 


50 


000120 


OOOOOOG 


51 


000122 


OOOOOOG 


52 


000124 


004014' 


53 


000126 


002410' 


54 


000130 


002432 ' 


55 


000132 


OOOOOOG 


56 


000134 


OOOOOOG 


57 


000136 


003336 ' 



S33TTL Branch vector for processing routines 



DEFINE PROCESSING ROUTINES FOR EACH EMT CODE 



EMT 375 FUNCTIONS 



EMTLST: . WORD 


DELETE ; 


. WORD 


LOOKUP i 


. WORD 


ENTER ; 


. WORD 


TRPSET i 


. WORD 


RENAME i 


. WORD 


SVSTAT > 


. WORD 


REOPEN J 


. WORD 


CLOSE J 


. WORD 


READ i 


. WORD 


WRITE i 


. WORD 


DOWAIT ; 


. WORD 


BADEMT i 


. WORD 


RTDEV i 


. WORD 


CDFN : 


. WORD 


EMT16 > 


. WORD 


BADEMT i 


. WORD 


GTJB i 


. WORD 


GETTIM i 


. WORD 


MRKT i 


. WORD 


CMKT i 


. WORD 


TIMWAT » 


. WORD 


BADEMT i 


. WORD 


BADEMT i 


. WORD 


CHSTAT ; 


. WORD 


SFPA i 


. WORD 


EMTXIT i 


. WORD 


SPFUN i 


. WORD 


EMTXIT i 


. WORD 


GVAL i 


. WORD 


SCCA i 


. WORD 


EMTPLX i 


. WORD 


BADEMT i 


. WORD 


SDTTM ; 


. WORD 


ESPCPS ; 


. WORD 


SFDATE i 


. WORD 


SFPROT i 


. WORD 


EMTXIT i 


. WORD 


CLOSZ i 


E375MX = 


<. -EMTLST>/2 


i 

i EMT 374 FUNCTIONS 


EMT374: . WORD 


DOWAIT i 


. WORD 


RTSPND i 


. WORD 


RTRSUM i 


. WORD 


PURGE i 


. WORD 


SERR i 


. WORD 


HERR i 


. WORD 


CLOSE ; 


. WORD 


EMTXIT > 


. WORD 


DOCIN > 






DELETE 


1 


LOOKUP 


2 


ENTER 


3 


SET TRAP 


4 


RENAME 


5 


SAVE STATUS 


6 


REOPEN 


7 


CLOSE 


10 


READ(CXW) 


11 


WRITE(CXW) 


12 


WAIT 


13 


COPY CHANNEL 


14 


DEVICE 


15 


DEFINE CHANNELS 


16 


GROUP 16 EMTS 


17 




20 


GTJB 


21 


GET TIME OF DAY 


22 


MARK TIME 


23 


CANCEL MARK TIME 


24 


TIMED WAIT 


25 


SEND DATA 


26 


RECEIVE DATA 


27 


CHANNEL STATUS 


30 


SET FPP EXCEPTION 


31 


PROTECT VECTORS 


32 


SPECIAL DEV FUNCTIONS 


33 


SET EXTRA SWAP ADDRESSES 


34 


. GVAL 


35 


. SCCA 


36 


. CRRG, . CRAW, . MAP, etc. 


37 


Multi-terminal support 


40 


. SDTTM 


41 


. SPCPS 


42 


. SFDAT — Set file date 


43 


. FPROT — Set file protection 


44 


UNKNOWN ! ! ! 


45 


. CLOSZ 






WAIT 


1 


SUSPEND THIS JOB 


2 


RESUME THIS JOB 


3 


PURGE A CHANNEL 


4 


SET SOFT ERRORS 


5 


SET HARD ERRORS 


6 


CLOSE 


7 


TEST S< LOCK USR 





CHAIN 



< 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 
Branch vector for processing routines 



58 

59 

60 

61 

62 

63 

64 

65 

66 

67 

68 

69 

70 

71 

72 

73 

74 

75 

76 

77 

78 

79 

80 

81 

82 

83 

84 

85 

86 

87 

88 

89 

90 

91 

92 

93 

94 

95 

96 

97 

98 

99 

100 

101 

102 

103 

104 

105 

106 

107 

108 

109 

110 

111 

112 

113 

114 



000140 
000142 
000144 



000146 
000150 
000152 
000154 
000156 
000160 
000162 
000164 
000166 
000170 
000172 
000174 
000176 
000200 
000202 
000204 
000206 
000210 
000212 
000214 
000216 
000220 
000222 
000224 
000226 
000230 
000232 
000234 
000236 
000240 
000242 
000244 
000246 
000250 
000252 
000254 
000256 
000260 
000262 
000264 
000266 
000270 
000272 
000274 
000276 
000300 
000302 
000304 
000306 



OOOOOOG 
004344 ' 
OOOOOOG 
000014 



000576 ' 
000616 ' 
000626 ' 
000636 ' 
000776 ' 
001016' 
001036' 
010404' 
010266' 
010462' 
011120' 
000646 ' 
OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 
000656 ' 
000666 ' 
010524' 
010542' 
000606 ' 
OOOOOOG 
006464 ' 
011172' 
011672' 
OOOOOOG 
011752' 
OOOOOOG 
OOOOOOG 
OOOOOOG 
010126' 
OOOOOOG 
003132' 
010236' 
OOOOOOG 
007326 ' 
OOOOOOG 
OOOOOOG 
011500' 
OOOOOOG 
OOOOOOG 
006322 ' 
010560' 
010704' 
OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 



E374MX 
RTUEX 



WORD BADEMT 

WORD DATE 

WORD ABTIO 

C -EMT374>/2 
C -Ei1TLST>/2 



Page 2-1 



11 MESSAGE WAIT 

12 . DATE 

13 . ABTIO 



EMT'S DEFINED BY TSX. 



TSXEMT: 



. WORD 


CLKOPN 


. WORD 


CUNLK 


. WORD 


RLOCK 


. WORD 


TRYLK 


. WORD 


XMSEND 


. WORD 


XMSGCK 


. WORD 


XMSGWT 


. WORD 


XSPLSP 


. WORD 


XGTLN 


. WORD 


XODTMD 


. WORD 


XGTTAB 


. WORD 


ULK1BK 


. WORD 


XHIOUT 


. WORD 


XHIIN 


. WORD 


XTERCK 


. WORD 


XRDTIM 


. WORD 


XHISET 


. WORD 


CSFACT 


. WORD 


5FSPND 


. WORD 


CKINAC 


. WORD 


SITINF 


. WORD 


CAPOPN 


. WORD 


KMNEMT 


. WORD 


SNDMSG 


. WORD 


TBLEMT 


. WORD 


REQPRV 


. WORD 


DETEMT 


. WORD 


rtpyw«|. / 


fcrfc I oKfV^> 


. WORD 


MOUNT 


. WORD 


DISMNT 


. WORD 


PMEMT 


. WORD 


TRMEMT 


. WORD 


RTEMT 


. WORD 


SETS I Z 


. WORD 


GETPPN 


. WORD 


SSEMT 


. WORD 


JBINFO 


. WORD 


GFINFO 


. WORD 


SFTIME 


. WORD 


EMUNAM 


. WORD 


SETPRI 


. WORD 


SPLEMT 


. WORD 


TTEMT 


. WORD 


INTEMT 


. WORD 


EMTSPD 


. WORD 


CLEMT 


. WORD 


ALCEMT 


. WORD 


MONEMT 


. WORD 


CPYEMT 



100 
101 
102 
103 
104 
105 
106 
107 
110 
HI 
112 
113 
114 
115 
116 
117 
120 
121 
122 
123 
124 
125 
126 
127 
130 
131 
13? 
"133 

135 
136 
137 
140 
141 
142 
143 
144 
145 
146 
147 
150 
151 
152 
153 
154 
155 
156 
157 
160 



Open shared file channel 

Unlock shared file channel 

Lock a specific block 

Try to lock a block 

Send a message 

See if message is pending 

Wait for a message 

Get # of free spool blocks 

Get TSX line # 

Set/reset ODT mode 

Get table pointer 

Unlock a single shared file block 

High-efficiency tty output 

High-efficiency tty input 

Check for TTY input error 

Set TT read timeout 

Turn high-efficiency mode on/off 

Check if shared file has been modified 

Suspend shared file channel 

Check for input activation chars 

Get TSX Site information 

Open shared file with access protection 

KMON EMT's 

Send a message to a line 

Access internal tsx table 

Request operator privilege 

Detached job control emt 

stablish break sentinal control I S>C2 L 
Mount a file structure 
Dismount a file structure 
Performance monitor EMT's 
Get terminal type 
Real-time EMT's 
TSX-Plus Settop 

Determine Project-Programmer number 
Control shared run-time systems 
Get information about a 
Get information about a 
Set file creation time 
Get or set user name 
Set job execution priority 
Spooling control for current channel 
Terminal control 

Set interactive/non-interactive mode 
Set terminal transmit/receive speed 
CL EMT's 

Allocate or deallocate a device 
Monitor status of a job 
Copy file/priv info from another job 



3F/T 



.0 



specific line 
file 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 
Branch vector for processing routines 



Wednesday 18-Jan-S9 10:37 Page 



115 
116 
117 
118 
119 



000310 
000312 
000314 
000316 



000730 ' 
0000000 
OOOOOOG 
010614' 
000147 





. WORD 


CKWIN 




. WORD 


VLSEMT 




. WORD 


LDMEMT 




. WORD 


SYFEMT 


EMTMAX 


= 


<. -EMTLST>/2 



161 Display window control 

162 Switch between processes 

163 Mount a logical disk structure 

164 Get system file dev: f ilspc. ext 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 
Branch vector for processing routines 



Wednesday 18-Jan-89 10: 37 Page 3 



1 

2 

3 

4 

5 

6 

7 

8 

9 

10 

11 

12 

13 

14 

15 

16 

17 

18 

19 



BRANCH VECTOR FOR EMTS IN THE RANGE 340 TO 357 



000320 
000322 
000324 
000326 
000330 
000332 
000334 
000336 
000340 
000342 
000344 
000346 
000350 
000352 
000354 
000356 



0000000 
0000000 
0000000 
OOOOOOG 
0000000 
OOOOOOG 
OOOOOOG 
OOOOOOG 
006236 ' 
OOOOOOG 
003420 ' 
003046 ' 
003060 ' 
003370 ' 
007150' 
003412' 



LST16: 


. WORD 


TTYIN 




. WORD 


TTYOUT 




. WORD 


DSTAT 




. WORD 


FETCH 




. WORD 


CSIGEN 




. WORD 


CSISPC 




. WORD 


EMTXIT 




. WORD 


EMTXIT 




. WORD 


EXIT 




. WORD 


PRINT 




. WORD 


SRESET 




. WORD 


QSET 




. WORD 


SETTOP 




. WORD 


RCTRLO 




. WORD 


ASTXIT 




. WORD 


HRESET 



340 


TTYIN 


341 


TTYOUT 


342 


DSTATUS 


343 


FETCH/REL 


344 


CSIGEN 


345 


CSISPC 


346 


LOCK USR 


347 


RELEASE USR 


350 


EXIT 


351 


PRINT 


352 


SRESET 


353 


QSET 


354 


SETTOP 


355 


RCTRLO 


356 


Completion routine exit 


357 


HRESET 



( 



TSEM2 TSX-Plus EMT Overlay 
EMT entry processing 



1 

2 

3 

4 

5 

6 

7 

8 

9 
10 
11 
12 

13 000360 

14 000364 

15 000372 

16 000374 

17 000402 
IS 000404 
19 

20 
21 

22 000410 

23 000414 

24 000420 

25 000422 
26 

27 
28 

29 000426 

30 000432 

31 000434 

32 000436 

33 000442 

34 000446 

35 000454 

36 000456 

37 000464 

38 000466 

39 000472 

40 000474 
41 

42 000476 

43 000502 

44 000506 

45 000512 

46 000516 

47 000520 

48 000524 

49 000530 

50 000534 

51 000536 
52 

53 
54 
55 
56 
57 000542 



113701 
032761 
001406 
032737 
001402 
004737 



113705 
020527 
103402 
000137 



120527 
001443 
005003 
153703 
012700 
032737 
001406 
032761 
001002 
012700 
020300 
103034 

010337 
013700 
062700 
020327 
103404 
162703 
062700 
070327 
060003 
010337 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 4 



SBTTL EMT entry processing 



Complete EMT entry processing and branch off to routine to do the 
actual processing of the EMT. 

At this point the EMT function code* channel number and arguments have 
been moved to EMTBLK which can be directly addressed from kernel mode 
within the EMT processing routines. 



If EMT tracing has been requested by SET EMT TRACE, 
print info about this EMT. 



OOOOOOG 
OOOOOOG OOOOOOG 

OOOOOOG OOOOOOG 

014010' 



00000 1G 
000147 

OOOOOOG 



000122 

OOOOOOG 
OOOOOOG 
OOOOOOG OOOOOOG 

OOOOOOG OOOOOOG 

OOOOOOG 



OOOOOOG 
OOOOOOG 
OOOOOOG 
000021 

000021 

ooooooc 

OOOOOOG 
OOOOOOG 



DOEMT: 



MOVB 

BIT 

BEQ 



C0RUSR,R1 i GET CURRENT JOB INDEX NUMBER 
#*EMTTR,LSW6<R1>; IS EMT TRACING WANTED? 



2* 



;BR IF NOT 



BIT #PO$DBG, PRIVCO » Are we authorized to do EMT tracing? 
BEQ 2* ; Br if not 

CALL EMTTRC * TRACE THE EMT 

Make sure the EMT function code is ok. 

?*: MOVB EMTBLK+1,R5 ; GET FUNCTION CODE 

FUNCTION CODE OK? 
BR IF OK 
INVALID EMT FUNCTION CODE 



MOVB 


EMTBLK+1,R5 : 


CMP 


R5, #EMTMAX ; 


BLO 


5* ; 


JMP 


BADEMT > 



Make sure channel number is ok. 



5$: CMPB 

BEQ 

CLR 

BISB 

MOV 

BIT 

BEQ 

BIT 

BNE 

MOV 
3*: CMP 

BHIS 
> Save address 

MOV 

MOV 

ADD 

CMP 

BLO 

SUB 

ADD 
1*: MUL 

ADD 

MOV 



R5, #<140+<RT11EX 

4* 

R3 

EMTBLK, R3 

#NLCHN, RO 

#UMODE, EMTPS 

3* 

#*INKMN, LSW4<R1) 

3* 

#NUCHN, RO 

R3, RO 

CHNERR 

of CSW for channe 

R3, CHNNUM 

CXTRMN, RO 

#R*CHN, RO 

R3, #21 

1* 

#21, R3 

#R*XCHN-R*CHN, RO 

#CHNSIZ, R3 

RO, R3 

R3, CHNADR 



100» ; IS THIS TSX REAL-TIME EMT? 

BR IF YES — ALLOW ANY CHANNEL NUMBER 

GET CHANNEL # WITHOUT SIGN EXTENSION 

MAX # CHANNELS FOR EACH JOB 

WAS EMT DONE IN USER OR KERNEL MODE? 

BR IF KERNEL MODE 

IS KMON RUNNING NOW? 

BR IF YES — ALLOW ACCESS TO ALL CHANNELS 

USER PROGRAM — RESTRICT TO CHANS 0-15. 

IS THIS CHANNEL # TOO BIG? 

BR IF YES 

1. 

SAVE USER'S CHANNEL NUMBER 

GET ADDRESS OF SIMULATED RMON 

POINT TO 1ST CHANNEL AREA 

IS THIS CHANNEL IN EXTENDED CHANNEL AREA? 

BR IF NOT 

GET CHANNEL # IN EXTENDED AREA 

POINT TO EXTENDED CHANNEL AREA 

MULTIPLY BY # BYTES PER CHANNEL 

GET ABSOLUTE ADDRESS OF CHANNEL AREA 

SAVE CURRENT CHANNEL ADDRESS 



Enter EMT processing routine. 

Rl contains user index number. 

URO contains contents of user's RO, put value here to return in RO. 



105037 OOOOOOG 



4*: 



CLRB 



CLZERR 



; Clear . CLOSZ error cell 



i 



TSEM2 TSX-Plus EMT Overlay 
EMT entry processing 

58 000546 006305 

59 000550 000175 000002' 
60 

61 
62 
63 

64 000554 113705 OOOOOOG 

65 000560 006305 

66 000562 000175 000320' 
67 

68 
69 
70 

71 000566 012700 177770 

72 000572 000137 0000000 



MACRO V05. 05 Wednesday 18-Jan-S9 10:37 Page 4-1 



ASL R5 

JMP @EMTLST<R5> 



i GET 2* FUNCTION CODE VALUE 

i JUMP TO EMT PROCESSING ROUTINE 



Sub-function jump routine for EMT's in the range 340-357 (group 16). 
EMT16: 



MQVB 


EMTBLK, R5 


ASL 


R5 


JMP 


@LST16<R5) 



Invalid channel number 



CHNERR: 



MOV 
JMP 



#-10, RO 
SETERR 



; GET SUB-FUNCTION CODE 

; #2 

j ENTER GROUP-16 PROCESSING ROUTINE 



; ERROR CODE # 



TSEM2 TSX-Plus EMT Overlay 
Shared file control EMT's 



MACRO V05. 05 Wednesday lS-Jan-S9 10:37 Page 5 



000576 
000602 



1 

2 

3 

4 

5 

6 

7 

8 

9 
10 
11 

12 000606 

13 000612 
14 

15 
16 
17 
18 

19 000616 

20 000622 
21 

22 
23 
24 
25 

26 000626 

27 000632 
28 

29 
30 
31 
32 

33 000636 

34 000642 
35 

36 
37 
38 

39 000646 

40 000652 
41 

42 
43 
44 

45 000656 

46 000662 
47 

48 
49 
50 
51 
52 

53 000666 

54 000672 

55 000676 
56 

57 



SBTTL Shared file control EMT's 



004737 
000177 



000702 ' 
OOOOOOG 



004737 
000177 



000702 ' 
OOOOOOG 



004737 
000177 



000702 ' 
OOOOOOG 



004737 
000177 



000702 ' 
OOOOOOG 



004737 000702 ' 
000177 OOOOOOG 



004737 000702 ' 
000177 OOOOOOG 



004737 000702 ' 
000177 OOOOOOG 



004737 000702 ' 
004777 OOOOOOG 
000137 OOOOOOG 



PROCESS THE . CLKOPN EMT WHICH IS USED TO OPEN A CHANNEL 
TO A SHARED FILE. 



CLKOPN: CALL CHKSF 

JMP ©DQCOPN 



; See if shared file support is available 
; Do the open 



Open a shared file with access protection. 



CAPOPN: CALL CHKSF 

JMP ©DOOPAP 



i See if shared file support is available 
;Open the channel 



PROCESS THE . CUNLK EMT WHICH IS USED TO UNLOCK 
A SHARED FILE CHANNEL. 



CUNLK: CALL 
JMP 



CHKSF 
SDOCULK 



; See if shared file support is available 
^Unlock all blocks on channel 



PROCESS THE . RLOCK EMT WHICH IS USED TO LOCK A 
SPECIFIC BLOCK. 



RLOCK: CALL 
JMP 



CHKSF 
©DORLK 



; See if shared file support is available 
> Loc k the bloc k 



PROCESS THE . TRYLK EMT WHICH IS USED TO TRY TO LOCK 
A SPECIFIC BLOCK. 



TRYLK: CALL 
JMP 



CHKSF 
@DOTLK 



» See if shared file support is available 
; Try to lock the block 



UNLOCK A SPECIFIC SHARED FILE BLOCK. 



ULK1BK: CALL CHKSF 

JMP SD0ULK1 



; See if shared file support is available 
; Unloc k a bloc k 



CHECK FOR WRITES TO A SHARED FILE BY OTHER USERS. 



CSFACT: CALL CHKSF 

JMP SDOSFCK 



i See if shared file support is available 
;Check for file modification 



SUSPEND A SHARED FILE CHANNEL 

THIS HAS THE SAME EFFECT ON THE SHARED FILE LOGIC AS DOING 

A . SAVESTATUS BUT THE CHANNEL IS UNAFFECTED. 



SFSPND: CALL 
CALL 
JMP 



CHKSF 

@SFSVST 

EMTXIT 



; See if shared file support is available 
i TELL SHARED FILE LOGIC 



€ 

< 
( 
I 
t 
i 
i 



12 TSX-Plus EMT Overlay 
Shared file control EMT ' s 

58 
59 
60 



MACRO V05. 05 Wednesday lS-Jan-8? 10:37 Page 5-1 



Determine if shared file support is genned into the system and the 
user is authorized to use it. If not> return error code for the EMT. 



61 000702 005737 0000000 CHKSF: TST 

62 000706 001405 BEQ 

63 000710 032737 OOOOOOG OOOOOOG BIT 

64 000716 001401 

65 000720 000207 
66 
67 
68 

69 000722 005000 

70 000724 000137 OOOOOOG 

71 
72 

73 
74 

75 000730 005737 OOOOOOG 

76 000734 001003 

77 000736 005000 

78 000740 000137 OOOOOOG 

79 000744 000137 OOOOOOG 



VMXSF ; Is shared file support genned in? 

10* ;Br if not 

#P2*RLK> PRIVC2 ; Are me privileged to access shared files? 
BEQ 10* ; Br if not 

RETURN 

We cannot use shared file support 
10*: CLR RO i Return error code O 



CLR 

JMP 



RO 
SETERR 



Display window control EMT' 5 
CKWIN: 



1*: 



TST 
BNE 
CLR 
JMP 
JMP 



VMXWIN 

1* 

RO 

SETERR 

EMTWIN 



; Is window support genned in? 

; Br if yes 

j Return error code 

; Enter window control overlay 



TSEM2 TSX-Plus EMT Overlay 
PLAS EMT's 

1 
2 
3 
4 
5 

6 000750 005737 OOOOOOG 

7 000754 001402 

8 000756 000137 OOOOOOG 
9 

10 
11 

12 000762 012700 000007 

13 000766 005037 OOOOOOG 

14 000772 000137 OOOOOOG 



MACRO V05. 05 Wednesday 18-Jan-S9 10:37 Page 6 

. SBTTL PLAS EMT's 



The following code is called when any PLAS related EMT is executed. 
It checks to see if the PLAS support was generated into the system. 



EMTPLX: TST 
BEG 
JMP 



VPLAS 
9* 

EMTPLS 



> Was PLAS support generated into system? 

i Br if not 

i Enter TSPLAS overlay 



Error: PLAS support not generated into system 



9*: 



MOV 

CLP, 
JMP 



#7, RO 

URO 

SETERR 



> Return error code 7 
■> Return O in RO 



TSEM2 TSX-Plus EMT Overlay 
Message communication EMT's 



1 
2 
3 
4 
5 
6 
7 



MACRO V05. 05 Wednesday lS-Jan-89 10:37 Page 7 



. SBTTL Message communication EMT's 



000776 
001002 

8 001006 

9 001014 
10 

11 
12 
13 
14 

15 001016 

16 001022 

17 001026 

18 001034 
19 

20 
21 
22 
23 

24 001036 

25 001042 

26 001046 

27 001054 
28 

29 
30 
31 
32 

33 001060 

34 001064 

35 001066 

36 001074 

37 001076 
38 

39 
40 

41 001100 

42 001102 



004737 
012700 

000417 



001060' 
OOOOOOG 



004737 001060' 
012700 OOOOOOG 

000407 



004737 001060' 
012700 OOOOOOG 

000137 OOOOOOG 



PROCESS THE . MSEND EMT WHICH 
ANOTHER USER. 



XMSEND: CALL 
MOV 
OCALL 
BR 



MSGPRV 
#EMTBLK, RO 
MSEND 
CHKERR 



QUEUES A MESSAGE FOR 



; Do we have access to message facility? 
;Point to EMT arg block 
; SEND THE MESSAGE 
i CHECK FOR ERRORS 



PROCESS THE . MSGCK EMT WHICH 
A PENDING MESSAGE. 



X MSGCK: 


CALL 


MSGPRV 




MOV 


#EMTBLK> RO 




OCALL 


MSGCK 




BR 


CHKERR 



IS USED TO CHECK FOR 



; Do we have access to message facility? 
; POINT TO EMT ARG BLOCK 
; CHECK FOR MESSAGE 
i GO CHECK FOR ERRORS 



PROCESS THE . MSGWT EMT WHICH 
A MESSAGE FROM ANOTHER USER. 



XMSGWT: CALL 
MOV 
OCALL 

CHKERR: JMP 



MSGPRV 
#EMTBLK, RO 
MSGWT 
EMTXIT 



IS USED TO WAIT FOR 



; Do we have access to message facility? 
; POINT TO EMT ARG BLOCK 
;WAIT FOR THE MESSAGE 



See if the message communication facility is genned into the system 
and we are authorized to use it. If not* return EMT error code 0. 



005737 OOOOOOG MSGPRV: TST 

001405 BEQ 

032737 OOOOOOG OOOOOOG BIT 

001401 BEQ 



VMAXMC 'Is message facility genned into system? 

10* i Br if not 

#P2*MSG» PRIVC2 ; Are we authorized to use message facility? 

10* > Br if not 



000207 



005000 

000137 OOOOOOG 



RETURN 
> We cannot access message facility 



10*: 



CLR 
JMP 



RO 
SETERR 



» Return error code O 



TSEM2 
. WRITE 



TSX-Plus EMT Overlay 



MACRO V05. 05 Wednesday lS-Jan-89 10:37 Page 8 



1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 



001106 
001112 
001116 
001124 
001126 
001132 



001136 
001144 
001146 
001152 
001156 
001164 
001166 
001172 



001176 
001202 
001204 
001206 
001212 



001216 
001222 
001230 
001232 
001236 



001242 
001246 
001250 



001254 
001262 



001264 
001270 
001274 
001276 
001302 



004737 
013703 
032763 
001004 
012700 
000137 



032737 
001414 
016302 
042702 
032762 
001404 
012700 
000137 



005737 
001405 
100016 
012700 
000137 



005037 
023727 
101402 
004737 
000137 



004737 
103402 
000137 



032763 
001171 



016302 
032702 
001404 
012700 
000137 



012172' 
OOOOOOG 
OOOOOOG OOOOOOG 

000002 
OOOOOOG 



. 5BTTL .WRITE 

Process a . WRITE EMT. 

WRITE: CALL CKIOST ; SEE IF SCHEDULER WANTS TO STOP I/O 

MOV CHNADR, R3 ; GET ADDRESS OF CHANNEL 

BIT #CS*OPN, C. CSW<R3); IS THE CHANNEL OPEN? 
BNE 6* ; BR IF YES 

MOV #2, RO i CHANNEL NOT OPEN 

JMP SETERR 

Check to make sure the buffer is on a word boundary 



000001 000004G 6*: 

OOOOOOG 

177701 

OOOOOOG OOOOOOG 

177766 
OOOOOOG 



BIT 
BEQ 
MOV 
BIC 
BIT 
BEQ 
MOV 
JMP 



#1, EMTBLK+4 

15* 

C. CSW<R3>, R2 

#^C76, R2 



i Is buffer address even? 

i Br if yes 

;Get CSW 

; Get device table index 



#DX*EBA, DVFLAG<R2); Does this device require even buffer addr? 



15* 

#-12, RO 
SETERR 



Make sure word count is ok 



000006G 



177766 
OOOOOOG 



15*: 



TST 
BEQ 
BPL 
MOV 
JMP 



EMTBLK+6 
17* 
18* 

#-12, RO 
SETERR 



; Br if not 

j Get abort code 

; Abort the operation 



; Is word count negative 032727. )? 

» Br if word count zero 

iBranch if valid size (positive) 

; Get abort code 

j Abort the operation 



OOOOOOG 

0000 10G 000001 

OOOOOOG 
OOOOOOG 



012146' 
OOOOOOG 



Word count is zero ==> Seek. 

Treat seek like nop but call completion routine if requested. 

17*. CLR URO ; Say zero words read 

; Need to run completion routine? 

> Br if not 

iCall completion routine 

19*: JMP EMTXIT # Finished with read 



CLR 


URO 


CMP 


EMTBLK+10, #1 


BLOS 


19* 


CALL 


FAKCMP 


JMP 


EMTXIT 



See if we are writing to TT: 



18*: 



CALL 


CHKTT 


BCS 


10* 


JMP 


WRITTT 



IS CHANNEL OPENED TO "TT: "? 

BR IF NOT WRITING TO TT 

ENTER THE TT WRITE ROUTINE IN TSTTY 



See if we are writing to a spooled device. 



OOOOOOG OOOOOOG 10*: 



BIT #CS*SPL, C. CSW<R3); IS THIS A SPOOLED DEVICE? 
BNE WRTSPL ; BR IF IT IS A SPOOLED DEVICE 



See if we are attempting to write to a read-only device. 



OOOOOOG 
OOOOOOG 

177763 
OOOOOOG 



MOV C. CSW(R3),R2 

BIT #CS*RON* R2 

BEQ 9* 

MOV #-15, RO 

JMP SETERR 



GET CSW 

IS USER AUTHORIZED FOR READ-ONLY ACCESS? 

BR IF NOT READ-ONLY 

SET ABORT ERROR CODE 

ABORT EMT 



i 



TSEM2 
. WRITE 

58 

59 

60 

61 

62 

63 

64 

65 

66 

67 

68 

69 

70 

71 

72 

73 

74 

75 

76 

77 

78 

79 

80 

81 

82 

83 

84 

85 

86 

87 

88 

89 

90 

91 

92 

93 

94 

95 

96 

97 

98 

99 

100 

101 

102 

103 

104 

105 

106 

107 

108 

109 

110 

111 

112 

113 

114 



TSX-Plus EMT Overlay 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 8-1 



001306 
001312 
001320 
001322 
001326 
001330 



001334 
001342 
001344 
001352 
001356 



001370 
001372 



001376 
001402 
001404 
001412 
001414 
001422 
001424 
001432 
001434 



001446 
001452 
001454 
001460 
001462 
001466 
001470 
001474 
001476 
001502 
001504 
001512 
001514 
001520 
001524 



042702 
032762 
001405 
005037 
005000 
000137 



032763 
001407 
042763 
012700 
000137 



032761 
001402 
004737 



177701 9*: 

OOOOOOG OOOOOOG 

OOOOOOG 8*: 

OOOOOOG 



BIC 
BIT 
BEG. 
CLR 
CLR 
JMP 



#-^C76, R2 ;GET DEVICE TABLE INDEX 
#DS*RON, DVSTAT(R2)i IS THIS A READ-ONLY DEVICE? 



5* 
URO 
RO 
SETERR 



BR IF NOT READ-ONLY 
SAY WORDS WRITTEN 
RETURN ERROR CODE OF 



OOOOOOG OOOOOOG 5*: 

OOOOOOG OOOOOOG 

000001 

OOOOOOG 



OOOOOOG OOOOOOG 
013702' 



005763 
001017 
032762 
001413 
023727 
101007 
032737 
001403 



OOOOOOG 

OOOOOOG OOOOOOG 
000002G OOOOOOG 
OOOOOOG OOOOOOG 



001442 004737 OOOOOOG 



See if error status is pending in CSW for the channel 

BIT #CS*ERR, C. CSW<R3);DID A WRITE ERROR OCCUR? 

BEQ 20* i BR IF NOT 

BIC #CS*ERR, C. CSW<R3); CLEAR THE ERROR FLAG IN THE CSW 

MOV #1,R0 J RETURN ERROR CODE OF 1 

JMP SETERR 

Check if this is an I/O operation by IND 

20*: BIT #*INDRN, LSW5<R1>; IS IND RUNNING? 
BEQ 11* J BR IF NOT 

CALL INDIO .MAP I/O FOR IND 

If this is a write by a usei — mode program which has opened a file 
structured device in non-file-structured mode, clear the directory 
cache for the device. 

11*: TST C. SBLK(R3) ;Is device opened non-file-structured mode? 

BNE 16* i Br if not 

BIT #DS*DIR- DVSTAT<R2>; Is this a directory structured device? 

BEQ 16* > Br if not 

CMP EMTBLK+2, #DH**LB; Could this block contain directory? 

BHI 16* i Br if not 

BIT #UMODE, EMTPS .Was EMT executed in user mode? 

BEQ 16* ; Br if not — Probably TSUSR doing dir I/O 

OCALL CLRDIR > Clear out directory cache for device 

Build an I/O queue entry for the write request. 

16*: CALL GETQ J GET AN I/O QUEUE ENTRY 

Rl now points to a free I/O queue entry. 

Move arguments from EMTBLK to the queue entry. 



004737 
103473 
005761 
001470 
020063 
101416 
032713 
001413 
005763 
001004 
032762 
001004 
010063 
010061 
005461 



012300' 

OOOOOOG 

OOOOOOG 

OOOOOOG 

OOOOOOG 

OOOOOOG OOOOOOG 

OOOOOOG 
OOOOOOC 
OOOOOOG 



14*: 
2*: 



CALL 

BCS 

TST 

BEQ 

CMP 

BLOS 

BIT 

BEQ 

TST 

BNE 

BIT 

BNE 

MOV 

MOV 

NEG 



Do common queue setup 

Br if we must abort operation 

Is word count for transfer zero? 

Br if yes — Nothing to write 

Are we writing beyond previous end point? 

Br if not 

Was file opened with a .ENTER? 

Br if not 

Is this a directory operation? 

Br if not 

#DS*DIR> DVSTAT<R2) i Is this a directory structured device? 
2* ; Br if yes 

RO* C. USED<R3> ; Remember high-watei — mark within file 
RO* Q. ICSW+C. USED<R1 ); Store into chan blk in Q element too 
Q. WCNT<R1) ; Negative word count ==> write operation 



SETQ 

3* 

Q. WCNT(Rl) 

3* 

RO, C. USED(R3) 

2* 

#CS*ENT, (R3) 

2* 

C. SBLK(R3) 

14* 



TSEM2 
. WRITE 

115 
116 
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 
141 
142 
143 
144 
145 
146 
147 
148 
149 
150 
151 
152 
153 
154 
155 
156 
157 
158 
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 
171 



TSX-Plus EMT Overlay 



MACRO V05. 05 Wednesday 18-Jar»-89 10:37 Page 8-2 



If we shortened write request because we hit end of file* return error 
code of but go ahead and do the write. 



001530 023737 OOOOOOG 

001536 001403 

001540 052737 OOOOOOG 



001546 013700 0000100 
001552 004737 013000' 
001556 103431 



000006G 
OOOOOOG 



CMP URO, EMTBLK+6 

BEQ 7* 

BIS #CFLAG, EMTPS 



DID WE SHORTEN WRITE REQUEST? 

BR IF NOT 

SET C-FLAG IN PS 



Set address of write completion routine. 



7*: MOV EMTBLK+10, RO 
CALL SETCR 
BCS 3* 



GET ADDRESS OF COMPLETION ROUTINE 

STORE ADDR OF COMPL ROUTINE INTO QUEUE ELEM 

BR IF FATAL ERROR 



001560 004737 OOOOOOG 



We have built the I/O queue element. 
Initiate the I/O operation. 

CALL QIO i QUEUE AN I/O REQUEST 

See if we are writing to a shared file 



001564 
001570 
001572 



001576 
001602 
001604 



001610 
001616 
001620 
001626 
001632 



005737 
001402 
004777 



005737 
001015 
004737 



032763 
001407 
042763 
012700 
000137 



OOOOOOG 
OOOOOOG 

0000 10G 
OOOOOOG 

OOOOOOG OOOOOOG 

OOOOOOG OOOOOOG 

000001 

OOOOOOG 



TST 


JCDB 


BEQ 


12* 


CALL 


SSFWRIT 



i Does job have any shared files open? 

; Br if not 

jCheck for writes to shared files 



See if we should wait for the I/O operation to finish. 



12*: 



TST 


EMTBLK+10 


BNE 


1* 


CALL 


IOWAIT 



IS THIS AN . WRITW? 

BR IF NOT 

WAIT FOR I/O TO FINISH 



001636 000137 OOOOOOG 



001642 000137 002374' 



001646 



001654 
001662 
001664 



See if a hardware error occured on the write 

BIT #CS*ERR,C. CSW<R3);DID A WRITE ERROR OCCUR? 

BEQ 1* iBR IF NOT 

BIC #CS*ERR,C. CSW(R3); CLEAR THE ERROR FLAG IN THE CSW 

MOV #1,R0 i RETURN ERROR CODE OF 1 

JMP SETERR 

Finished the EMT. 
1*: JMP EMTXIT iEXIT FROM EMT 

Some fatal error occured which causes us to have to abort the operation. 
3*: JMP IOABRT i ABORT THE I/O REQUEST 

Write to a spooled device. 
WRTSPL: OCALL SDMOVE > WRITE USER'S DATA TO SPOOL FILE 

See if we need to queue a completion routine for this write request. 



023727 0000 10G 

101402 

004737 OOOOOOG 



000001 WRTCPL: CMP 

BLOS 
CALL 



EMTBLK+10, #1 

1* 

FAKCMP 



WAS A COMPLETION ROUTINE SPECIFIED? 

BR IF NOT 

QUEUE A COMPLETION ROUTINE REQUEST 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 8-3 
. WRITE 

172 i Finished spooled write 

173 ; 

174 001670 000137 OOOOOOG 1*: JMP EMTXIT 



TSEM2 
. READ 



TSX-Plus EMT Overlay MACRO V05. 05 Wednesday i8-Jan-89 10:37 Page 9 



1 
2 
3 
4 

5 001 

6 001 

7 001 
S 001 
9 001 

10 001 
11 
12 
13 

14 001 

15 001 

16 001 

17 001 
IS 001 

19 001 

20 001 

21 001 



674 
700 
704 
712 
714 
720 



724 
732 
734 
740 
744 
752 
754 
760 



23 
24 
25 

26 001764 

27 001770 

28 001772 

29 001774 

30 002000 
31 

32 
33 
34 

35 002004 

36 002010 

37 002016 

38 002020 

39 002024 
40 

41 
42 

43 002030 

44 002034 

45 002036 
46 

47 

48 

49 

50 

51 002042 

52 

53 

54 002046 

55 002052 

56 002060 

57 002062 



004737 
013703 
032763 
001004 
012700 
000137 



032737 
001414 
016302 
042702 
032762 
001404 
012700 
000137 



005737 
001405 
100016 
012700 
000137 



005037 
023727 
101402 
004737 
000137 



004737 
103402 
000137 



042700 
032760 
001405 
005037 



012172' 
OOOOOOG 

ooooooe 

000002 
OOOOOOG 



. SBTTL . READ 
Process a . READ EMT. 
READ: 



CALL 
MOV 
OOOOOOG BIT 

BNE 
MOV 
JMP 



CKIOST ; SEE IF SCHEDULER WANTS TO STOP I/O 

CHNADR, R3 ; GET ADDRESS OF THE CHANNEL 

#CS*OPN, C. CSW<R3)i IS THE CHANNEL OPEN? 

2* ;BR IF YES 

#2, RO i RETURN ERROR CODE 

SETERR 



Check to make sure the buffer is on a word boundary 



000001 000004G 2$: 



OOOOOOG 

177701 

OOOOOOG 

177766 
OOOOOOG 



000006G 



177766 
OOOOOOG 



OOOOOOG 
0000 10G 

OOOOOOG 
OOOOOOG 



012146' 
OOOOOOG 



016300 OOOOOOG 



177701 
OOOOOOG 

OOOOOOG 



OOOOOOG 



BIT 
BEG 
MOV 
BIC 
BIT 
BEG 
MOV 
JMP 



#1, EMTBLK+4 

15* 

C. CSW<R3>, R2 

# A C76, R2 



; Is buffer address even' 

> Br if yes 

; Get CSW 

; Get device table index 



#DX*EBA, DVFLAG<R2); Does this device require even buffer addr? 
15* ; Br if not 

#-12> RO i Get abort code 

SETERR i Abort the operation 



See if the read request is so large that 
a handler might interpret it as a write 



15*: 



TST 
BEG 
BPL 
MOV 
JMP 



EMTBLK+6 
17* 
14* 

#-12, RO 
SETERR 



j Is word count negative 032727. )? 

; Br if word count zero 

;Branch if valid size (positive) 

; Get abort code 

i Abort the operation 



Word count is zero =~> Seek. 

Treat seek like nop but call completion routine if requested. 



17*: 



000001 



19$: 



CLR 


URO 


CMP 


EMTBLK+10, #1 


BLOS 


19* 


CALL 


FAKCMP 


JMP 


EMTXIT 



i Say zero words read 

> Need to run completion routine? 

> Br if not 

;Call completion routine 

;Finished with read 



See if we are reading from TT: 



14*: 



CALL 


CHKTT 


BCS 


10* 


JMP 


TTREAD 



IS CHANNEL OPENED TO "TT: "? 

BR IF NOT TT READ 

TT READ FROM MAPPED TSTTY 



We are reading from some device other than TT. 

See if we are attempting to read from a write-only device. 



10*: 



OOOOOOG 



4*: 



MOV 
BIT 
BNE 
BIC 
BIT 
BEG 
CLR 



C. CSW<R3), RO 
#CS*SPL, RO 
4* 
# A C76, RO 



; GET CSW 

i IS THIS A SPOOLED DEVICE? 

;BR IF SPOOLED DEVICE 

i GET DEVICE TABLE INDEX FOR DEVICE 



#DS*WON, DVSTAT(RO); IS THIS A WRITE-ONLY DEVICE? 
7* ;BR IF NOT WRITE-ONLY 

URO > SAY WORDS READ 



TSEM2 TSX-Plus EMT Overlay 
. READ 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 9-1 



58 

59 

60 

61 

62 

63 

64 

65 

66 

67 

68 

69 

70 

71 

72 

73 

74 

75 

76 

77 

78 

79 

80 

81 

82 

83 

84 

85 

86 

87 

88 

89 

90 

91 

92 

93 

94 

95 

96 

97 

98 

99 

100 

101 

102 

103 

104 

105 

106 

107 

108 

109 

110 

111 

112 

113 

114 



002066 
002070 



002074 
002102 
002104 
002112 
002116 



002122 
002130 
002132 
002140 
002144 
002146 



002152 
002156 
002160 
002164 
002166 
002172 
002174 
002202 



002204 
002212 
002214 



005000 
000137 



032763 
001407 
042763 
012700 
000137 



032763 
001410 
042763 
005037 
005000 
000137 



005737 
001412 
005737 
001407 
004777 
103404 
013737 
000624 



032761 
001402 
004737 



OOOOOOG 



CLR 
JMP 



RO 
SETERR 



; RETURN ERROR CODE 



See if error flag is pending in CSW for this channel 



OOOOOOG OOOOOOG 7*: 

OOOOOOG OOOOOOG 

000001 

OOOOOOG 



BIT #CS*ERR,C. CSW<R3)i DID A HARDWARE ERROR OCCUR ON READ? 

BEG. 16* i BR IF NOT 

BIC #CS*ERR,C. CSW(R3>; ACKNOWLEDGE ERROR STATUS 

MOV #1,R0 i RETURN ERROR CODE OF 1 

JMP SETERR 



See if end-of-file status is pending in CSW for this channel 



OOOOOOG OOOOOOG 16*: 

OOOOOOG OOOOOOG 
OOOOOOG 

OOOOOOG 



BIT #CS*EOF, C. CSW<R3);DID DEVICE REPORT END OF FILE? 

BEQ 18* ; BR IF NOT 

BIC #CS*EOF, C. CSW<R3>; ACKNOWLEDGE EOF STATUS 

CLR URO i SAY O WORDS READ 

CLR RO ; RETURN ERROR CODE OF 

JMP SETERR 



See if data being read is currently in the data cache 



OOOOOOG 18*: 

OOOOOOG 

OOOOOOG 

000006G OOOOOOG 



TST 


JCDB 


BEQ 


8* 


TST 


NUMDCD 


BEQ 


8* 


CALL 


SDCRD1 


BCS 


8* 


MOV 


EMTBLK+6, URO 


BR 


WRTCPL 



Any shared file channels open for job? 

Br if not 

Are we doing shared-file data caching? 

Br if not 

SEE IF DATA IS IN DATA CACHE 

BR IF DATA WAS NOT IN THE CACHE 

RETURN WORD COUNT READ IN USER'S RO 

FINISH UP AND EXIT 



Check for I/O operations by IND 



OOOOOOG OOOOOOG 8*. 
013702' 



BIT #*INDRN, LSW5<R1); IS IND RUNNING? 

BEQ 11* ; BR IF NOT 

CALL INDIO ; MAP I/O OPERATIONS FOR IND 



002220 004737 



002224 
002230 
002232 
002236 
002242 
002244 
002252 



004737 
103461 
013700 
004737 
103004 
112737 
000450 



OOOOOOG 

012300' 

0000 10G 
013000' 

177766 OOOOOOG 



002254 004737 OOOOOOG 



002260 005737 OOOOOOG 



Build I/O queue element for I/O operation. 

11*: CALL GETQ i GET A FREE I/O QUEUE ELEMENT 

; Rl now points to a free I/O queue element. 

DO COMMON QUEUE SETUP 

BR IF FATAL ERROR DETECTED 

GET COMPLETION ROUTINE ADDRESS 

STORE COMPL RTN ADDR IN I/O QUEUE 

BR IF ADDRESS OK 

SET ERROR CODE 

ABORT OPERATION 

We have build an I/O queue entry for read request. 
Initiate the I/O operation. 

3*: CALL QIO > QUEUE THE REQUEST 

See if we need to update data cache 

TST JCDB > Any shared file channels for job? 



CALL 


SETQ 


BCS 


IOABRT 


MOV 


EMTBLK+10, RO 


CALL 


SETCR 


BCC 


3* 


MOVB 


#-12, INTERR 


BR 


IOABRT 



TSEM2 
. READ 



TSX-Plus EMT Overlay 



MACRO V05. 05 Wednesday 18-Jan-89 10: 37 Page 9-2 



115 
116 
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 
141 
142 
143 
144 
145 
146 
147 
148 
149 
150 
151 
152 



002264 
002266 
002272 
002274 



002300 
002304 
002306 



002312 
002320 
002322 
002330 
002334 



002340 
002346 
002350 
002356 
002362 
002364 



001405 
005737 
001402 
004777 



005737 
001031 
004737 



032763 
001407 
042763 
012700 
000137 



032763 
001410 
042763 
005037 
005000 
000137 



0000000 
OOOOOOG 

0000 10G 
OOOOOOG 

OOOOOOG OOOOOOG 

OOOOOOG OOOOOOG 

000001 

OOOOOOG 



BEG. 


12* 


TST 


NUMDCD 


BEQ 


12* 


CALL 


SDCRD2 



; Br if not 

i Are we doing shared-file data caching? 

; Br if not 

i See if ute need to update data cache 



See if we should wait for the I/O operation to finish. 



12*: 



TST 


EMTBLK+10 


BNE 


1* 


CALL 


IOWAIT 



SHOULD WE WAIT? 

BR IF NOT 

WAIT FOR I/O OPERATION TO FINISH 



See if a hardware error occured on the read 

BIT #CS*ERR, C. CSW<R3)J DID A HARDWARE ERROR OCCUR ON READ? 

BEQ 6* ; BR IF NOT 

BIC #CS*ERR>C. CSW<R3)i ACKNOWLEDGE ERROR STATUS 

MOV #1,R0 ; RETURN ERROR CODE OF 1 

JMP SETERR 



See if the device reported end-of-file. 



OOOOOOG OOOOOOG 6*: 

OOOOOOG OOOOOOG 
OOOOOOG 



OOOOOOG 



BIT #CS*EOF, C. CSW<R3); DID DEVICE REPORT END OF FILE? 

BEQ 1* ;BR IF NOT 

BIC #CS*EOF, C. CSW(R3)i ACKNOWLEDGE EOF STATUS 

CLR URO i SAY WORDS READ 

CLR RO ; RETURN ERROR CODE OF O 

JMP SETERR 



002370 000137 OOOOOOG 



Finished operation. 

1*: JMP EMTXIT 

We detected a fatal error before queueing the request. 
Return the I/O queue entry to the free list. 



002374 004737 OOOOOOG 
002400 1 1 3700 OOOOOOG 
002404 000137 OOOOOOG 



IOABRT: CALL 
MOVB 
JMP 



QFREE 
INTERR, RO 
SETERR 



RETURN I/O QUEUE ENTRY TO FREE LIST 
GET ERROR CODE 
ERROR RETURN 



TSEM2 


TSX-Plus EMT Ov 


erlay 


. SERR 








1 
2 








3 








4 


002410 


113700 


OOOOOOG 


5 


002414 


010037 


OOOOOOG 


6 


002420 


112737 


000001 


7 


002426 


000137 


OOOOOOG 


8 








9 








10 








11 








12 


002432 


1 1 3700 


OOOOOOG 


13 


002436 


010037 


OOOOOOG 


14 


002442 


105037 


OOOOOOG 


15 


002446 


000137 


OOOOOOG 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 10 



SDTTL . SERR 



; PROCESS THE 
SERR: MQVB 
MOV 
OOOOOOG MOVB 

JMP 

. SBTTL 



SERR EMT 
SERFLG, RO 
RO, URO 
#1, SERFLG 
EMTXIT 

. HERR 



; PROCESS THE 
HERR: MOVB 
MOV 
CLRB 
JMP 



HERR EMT 
SERFLG, RO 
RO, URO 
SERFLG 
EMTXIT 



GET PREVIOUS STATE 
AND RETURN TO USER 
REMEMBER USER ISSUED SERR 



GET PREVIOUS STATE 
AND RETURN TO USER 
TURN OFF . SERR CONTROL 



TSEM2 


TSX-Plus EMT Ov 


erlay MACRO V 


. SPFUN 








1 

2 








3 








4 








5 


002452 


004737 


012172' 


6 


002456 


013703 


OOOOOOG 


7 


002462 


016302 


OOOOOOG 


S 


002466 


032702 


OOOOOOG 


9 


002472 


001004 




10 


002474 


012700 


000002 


11 
12 
13 


002500 


000137 


OOOOOOG 








14 








15 


002504 


042702 


177701 


16 


002510 


032762 


OOOOOOG OOOOOOG 


17 


002516 


001002 




18 


002520 


000137 


OOOOOOG 


19 








20 








21 








22 


002524 


105737 


00001 1G 


23 


002530 


002403 




24 


002532 


005000 




25 


002534 


000137 


OOOOOOG 


26 


002540 


1 1 2737 


000377 0000 10G 


27 








28 








29 








30 


002546 


032762 


OOOOOOG OOOOOOG 


31 


002554 


001413 




32 


002556 


032737 


OOOOOOG OOOOOOG 


33 


002564 


001007 




34 


002566 


120237 


OOOOOOG 


35 


002572 


001404 




36 


002574 


012700 


177747 


37 


002600 


000137 


OOOOOOG 


38 








39 








40 








41 


002604 


004737 


OOOOOOG 


42 








43 








44 








45 








46 


002610 


113761 


00001 1G OOOOOOG 


47 








48 








49 








50 


002616 


004737 


012300' 


51 


002622 


103443 




52 








53 








54 








55 


002624 


013700 


00001 2G 


56 


002630 


004737 


013000' 


57 


002634 


103436 





MACRO V05. 05 Wednesday 18-Jan-S9 10:37 Page 11 

. SBTTL . SPFUN 
Perform special device functions. 



SPFUN: 



CALL 


CKIOST 


MOV 


CHNADR, R3 


MOV 


C. CSW<R3>, R2 


BIT 


#CS*OPN, R2 


BNE 


1* 


MOV 


#2, RO 


JMP 


SETERR 



See if scheduler wants to hold I/O starts 

GET ADDRESS OF CHANNEL BLOCK 

GET CSW 

IS CHANNEL OPEN? 

BR IF YES 

ERROR 2 IF CHANNEL NOT OPEN 



See if device can accept special functions. 



1*: 



4*: 



BIC 
BIT 
BNE 
JMP 



#177701, R2 ; EXTRACT DEVICE TABLE INDEX # 

#DS*SFN, DVSTAT<R2); CAN DEVICE HANDLE SPECIAL FUNCTIONS? 



2* 
EMTXIT 



; BR IF YES 

; IGNORE . SPFUN REQUEST 



Chf?ck function code 



2*: TSTB EMTBLK+11 

BLT 3* 

CL.R RO 

JMP SETERR 

MOVB #377,EMTBLK+10 ; MAKE SURE EVEN BYTE 



i FUNCTION CODE MUST BE NEGATIVE 

i BR IF OK 

; ERROR CODE IF NOT NEGATIVE FUNCTION 



3*: 



377 



Make sure user is privileged to do .SPFUN's 



BIT 


#DS*DIR, D VST AT 


BEQ 


7* 


BIT 


#PO*SPF, PRIVCO 


BNE 


7* 


CMPB 


R2, LDDEVX 


BEQ 


7* 


MOV 


#-31, RO 


JMP 


SETERR 



#DS*DIR, DVSTAT<R2> i Is this a directory-structured device? 

; Br if not 

> Is user authorized to do .SPFUN? 
; Br if yes 

i Is this a .SPFUN to device LD? 
j Br if yes — That is ok 
; Error -31 — Not authorized for .SPFUN 



Get a free I/O queue element and set it up. 

7*: CALL GETQ .GET A FREE I/O QUEUE ELEMENT 

Rl now points to I/O queue element. 

Set special function code in queue element. 

MOVB EMTBLK+lli Q. FUNC<R1)J STORE SPECIAL-FUNCTION CODE VALUE 

Set up buffer address and other info in queue element 



CALL 
BCS 



SETQ 
9* 



i SET UP BUFFER ADDRESS AND WORD COUNT 
; BR IF SOME ERROR DETECTED 



Set up address of completion routine. 



MOV 


EMTBLK+12, RO 


CALL 


SETCR 


BCS 


9* 



GET ADDRESS OF COMPLETION ROUTINE 

SET UP COMPL ADDR IN QUEUE ELEMENT 

BR IF INVALID COMPLETION QUEUE ADDRESS 



TSEM2 TSX-Plus EMT Overlay 



MACRO V05. 05 Wednesday 18-Jan-S9 10:37 Page 11-1 



58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 



002636 004737 OOOOOOG 



Initiate the I/O operation. 

CALL QIO ; QUEUE THE I/O REQUEST 

See if we should wait for the I/O operation to finish. 



002642 
002646 



005737 
001002 



0000 12G 



TST 
BNE 



EMTBLK+12 
13* 



; IS WAIT REQUESTED? 
; BR IF NOT 



002650 004737 OOOOOOG 



Wait for I/O to finish 

CALL IOWAIT ;WAIT FOR I/O TO FINISH 

See if a hardware error or end-of-file occured. 



002654 
002662 
002664 
002672 
002676 
002702 
002710 
002712 
002720 
002722 



032763 
00 1 407 
042763 
012700 
000137 
032763 
001406 
042763 
005000 
000137 



OOOOOOG OOOOOOG 13*: 



OOOOOOG OOOOOOG 
000001 
OOOOOOG 
OOOOOOG OOOOOOG 



6*: 



OOOOOOG OOOOOOG 
OOOOOOG 



002726 000137 OOOOOOG 



002732 



000137 002374' 



BIT #CS*ERR,C. CSW(R3);DID A HARDWARE ERROR OCCUR? 

BEQ 6* ; BR IF NOT 

BIC #CS*ERR,C. CSW(R3); CLEAR ERROR FLAG IN CSW 

MOV #1,R0 ; REPORT ERROR 

JMP SETERR 

BIT #CS*EOF>C. CSW(R3>; DID WE HIT END-OF-FILE? 

BEQ 5* i BR IF NOT 

BIC #C5*E0F, C. CSW <R3>; CLEAR END-OF-FILE FLAG IN CSW 

CLR RO ; RETURN ERROR CODE OF 

JMP SETERR 



Normal completion of . SPFUN 
5*: JMP EMTXIT ; FINISHED EMT 

Some fatal error occured. Abort request. 
9*: JMP IOABRT ; ABORT I/O REQUEST 



TSEM2 
. SCCA 



TSX-Plus EMT Overlay 



1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 



002736 
002744 
002750 
002754 
002760 



002762 
002766 
002772 
002776 



003002 
003006 
003012 
003016 
003020 
003022 
003030 
003032 
003036 
003040 
003044 



003046 
003054 



003060 
003064 
003066 
003070 
003072 
003076 
003102 
003104 
003110 



016137 
013700 
004737 
010061 
000406 



013700 
004737 
010037 
000137 



013700 
004737 
010037 
005700 
001407 
032737 
001403 
110137 
000402 
105037 
000754 



013737 
000137 



013700 
005200 
001001 
005300 
042700 
020037 
103404 
013700 
162700 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 12 

. SBTTL . SCCA 
PROCESS THE . SCCA EMT 



OOOOOOG OOOOOOG SCCA: 

0000020 

OOOOOOG 

OOOOOOG 



MOV 

MOV 

CALL 

MOV 

BR 



000002G 
OOOOOOG 
OOOOOOG 
OOOOOOG 



. SBTTL 
PROCESS THE 

TRPSET: MOV 
CALL 
MOV 

JNOP: JMP 



LSCCA(Rl), URO 

EMTBLK+2, RO 

VALADW 

RO, LSCCA(Rl) 

JNOP 

. TRPSET 

TRPSET EMT 

EMTBLK+2, RO 
VALADW 
RO, UTRPAD 
EMTXIT 



RETURN OLD SCCA RTN ADDRESS TO USER IN RO 

GET ADDRESS OF SCCA ROUTINE 

VALIDATE THE ADDRESS 

SAVE ADDRESS OF SCCA ROUTINE FOR JOB 



GET ADDRESS OF USER'S TRAP ROUTINE 

VALIDATE THE ADDRESS 

SET TRAP ROUTINE ADDRESS FOR JOB 



. SBTTL . SFPA 



PROCESS THE . SFPA EMT 



000002G 
OOOOOOG 
OOOOOOG 



OOOOOOG OOOOOOG 
OOOOOOG 



SFPA: 



OOOOOOG 



2*: 
3*: 



MOV EMTBLK+2, RO 

CALL VALADB 

MOV RO, UFPTRP 

TST RO 

BEQ 2* 

BIT #CW*FPU, CONF I G 

BEG. 2* 

MOVB R1,FPUUSE 

BR 3* 

CLRB FPUUSE 

BR JNOP 

. SBTTL . QSET 



GET ADDRESS OF TRAP ROUTINE 

VALIDATE IT (NOTE: ADDRESS MAY 

SET ADDRESS OF TRAP ROUTINE 

IS USER GOING TO USE FPU UNIT? 

BR IF NOT 

DOES SYSTEM HAVE A FPU UNIT? 

BR IF NOT 

REMEMBER USER IS ACCESSING FPU 

i SAY FPU NOT IN USE 



« 1) 



Process the .QSET EMT. 

This is essentially a NOP under TSX-Plus. 

The address beyond the end of the queue buffer is returned in RO. 



000004G OOOOOOG QSET: 
OOOOOOG 



MOV 

JMP 

. SBTTL 



EMTBLK+4, URO 
EMTXIT 

. SETTOP 



; Return address of Q buffer in RO 
; Finished with EMT 



PROCESS THE . SETTOP EMT 



OOOOOOG 



000001 
OOOOOOG 

OOOOOOG 
000002 



SETTOP : 
SETTP1: 



?*: 



MOV 
INC 
BNE 
DEC 
BIC 
CMP 
BLO 
MOV 
SUB 



URO, RO 

RO 

2* 

RO 

#1, RO 

RO, ODTBAS 

1* 

ODTBAS, RO 

#2, RO 



GET USER'S REQUESTED TOP ADDRESS 

BOUND ADDRESS UP TO WORD IF IT'S ODD 

BR IF DID NOT OVERFLOW 

IF OVERFLOWED, FORCE BACK TO 177777 

FORCE ADDRESS TO BE EVEN 

DOES REQUEST EXCEED JOB'S LIMIT? 

BR IF NOT 

GET MAX AMT JOB IS ALLOWED TO USE 

POINT TO WORD BELOW TOP LIMIT 



TSEM2 
. SETTOP 



TSX-Plus EMT Overlay 



58 003114 

59 003120 

60 003122 

61 003126 
62 

63 
64 
65 
66 
67 
68 
69 
70 
71 

72 003132 

73 003136 

74 003142 

75 003144 

76 003150 

77 003152 

78 003156 

79 003162 

80 003164 

81 003166 

82 003170 

83 003174 

84 003176 

85 003202 

86 003206 

87 003210 

88 003216 

89 003222 

90 003226 

91 003234 

92 003240 

93 003244 

94 003250 



010037 
010046 
106637 
000137 



013700 
105737 
001750 
120137 
001745 
013702 
162702 
020002 
101401 
010200 
010037 
010046 
106637 
020027 
103412 
052761 
016146 
106637 
052761 
062700 
010037 
004737 
000137 



0000000 

000050 
0000000 



MACRO V05. 05 



1*: 



Wednesday 


18-Jan-S 


MOV 


RO, URO 


MOV 


RO, -(SP) 


MTPD 


©#50 


JMP 


EMTXIT 



10: 37 Page 12-1 



{RETURN TOP ADDRESS IN USER'S RO 
; AND IN LOCATION 50 

; FINISHED 



The TSX-Plus SETSIZ emt is used to change the memory space allocated 
to a job. 



The form of the EMT arqument block is: 



0000020 
OOOOOOG 

0000000 

OOOOOOG 
000002 



0000000 

000050 
160000 

OOOOOOG OOOOOOG 

OOOOOOG 

OOOOOOG 

OOOOOOG OOOOOOG 

000002 

OOOOOOG 

OOOOOOG 

OOOOOOG 



SETSIZ: 



1*: 



2*: 



. BYTE 


0, 141 


. WORD 


. top-addr 


MOV 


EMTBLK+2, RO 


TSTB 


VSWPFL 


BEQ 


SETTP1 


CMPB 


R1,EXCJ0B 


BEQ 


SETTP1 


MOV 


MXJADR, R2 


SUB 


#2, R2 


CMP 


RO, R2 


BLOS 


1* 


MOV 


R2, RO 


MOV 


RO, URO 


MOV 


RO, -(SP) 


MTPD 


@#50 


CMP 


RO, #160000 


BLO 


2$ 


BIS 


#VIMAGE, LJSW(R1 


MOV 


LJSW(Rl), -(SP) 


MTPD 


S#JSWLOC 


BIS 


#*VIRJB,LSW9(R1 


ADD 


#2, RO 


MOV 


RO, ODTBAS 


CALL 


SUTOP 


JMP 


EMTXIT 



; Requested top address for job 

GET REQUESTED TOP OF JOB ADDRESS 

IS THIS A NON-SWAPPING SYSTEM? 

IF NON-SWAPPING THEN CAN'T CHANGE SIZE 

DOES JOB HAVE EXCLUSIVE ACCESS TO SYSTEM? 

IF YES THEN CAN'T CHANGE SIZE 

GET ADDRESS ABOVE TOP OF AVAILABLE SPACE 

GET ADDRESS OF TOP AVAILABLE WORD 

IS REQUEST ABOVE TOP ALLOWED? 

BR IF NOT 

CONSTRAIN TO TOP ALLOWED ADDRESS 

RETURN TOP ADDRESS TO USER IN RO 

AND PUT IN USER'S LOCATION 50 



; IS JOB NOW USING MORE THAN 56KB? 
i BR IF NOT 
);SET VIRTUAL-JOB FLAG 



ALSO SET IN INTERNAL SYSTEM TABLE 
GET ADDRESS ABOVE TOP WORD WANTED 
CONSTRAIN . SETTOP TO THIS 
DO MEMORY ALLOCATION FOR JOB 
FINISHED 



TSEM2 


TSX-Plus EMT Dv 


erlay 


. GTJB 








1 

2 








3 








4 








5 


003254 


013700 


000002G 


6 


003260 


004737 


OOOOOOG 


7 


003264 


010146 




8 


003266 


006216 




9 


003270 


106620 




10 


003272 


013746 


OOOOOOG 


11 


003276 


106620 




12 


003300 


005046 




13 


003302 


106620 




14 


003304 


012746 


OOOOOOC 


15 


003310 


106620 




16 


003312 


005046 




17 


003314 


106620 




IS 


003316 


010146 




19 


003320 


006216 




20 


003322 


106620 




21 


003324 


013746 


oooooog 


22 


003330 


106620 




23 


003332 


000137 


OOOOOOG 



MACRO V05. 05 Wednesday lS-Jan-89 10:37 Page 13 



SBTTL 



GTJB 



GTJB: 



GTJJ: 



:ss THE 


. GTJB EMT 




MOV 


EMTBLK+2, RO 




CALL 


VALADW 




MOV 


Rl, -(SP) 




ASR 


(SP) 




MTPD 


(R0) + 




MOV 


ODTBAS, -(SP) 




MTPD 


(R0> + 




CLR 


-(SP) 




MTPD 


(R0) + 




MOV 


#RMNBAS+R*CHN- 




MTPD 


(R0) + 




CLR 


-(SP) 




MTPD 


(R0) + 




MOV 


R 1 j - ( SP ) 




ASR 


(SP) 




MTPD 


(R0) + 




MOV 


ODTBAS, -(SP) 




MTPD 


<R0) + 


t 


JMP 


EMTXIT 





GET ADDRESS OF USER'S BUFFER 
VALIDATE BUFFER ADDRESS 
RETURN JOB # 

CWORD ID 

HIGH MEMORY LIMIT 

CWORD 31 

LOW MEMORY 

CWORD 33 

(SP) J START OF JOB CHANNEL AREA 

CWORD 43 

ADDRESS OF JOB'S IMPURE AREA 

CWORD 53 

JOB'S TERMINAL NUMBER 

CWORD 63 

VIRTUAL HIGH LIMIT 

CWORD 73 



TSEM2 


TSX-Plus EMT Ov 


'er lay 


. CHAIN 

1 
2 
3 














4 








5 


003336 


105237 


OOOOOOG 


6 








7 








8 








9 


003342 


012702 


000500 


10 


003346 


012703 


OOOOOOG 


11 


003352 


012704 


000140 


12 


003356 


106522 




13 


003360 


012623 




14 


003362 


077403 




15 


003364 


004737 


OOOOOOG 


16 








17 








18 








19 








20 








21 


003370 


032761 


OOOOOOG 


22 




003376 




23 


003376 


001003 




24 


003400 


042761 


OOOOOOG 


25 


003406 


000137 


OOOOOOG 



MACRO V05. 05 Wednesday 18-Jan~89 10:37 Page 14 

. SBTTL . CHAIN 

PROCESS A . CHAIN REQUEST. 

DOCIN: INCB CINFLG i SAY .CHAIN IN PROGRESS 

Move chain data to job context area. 

MOV #500, R2 i POINT TO START OF CHAIN DATA AREA 

MOV #CINDAT, R3 ; POINT TO CHAIN DATA SAVE AREA IN CONTEXT BLK 

MOV #«1000-500>/2>, R4 ; GET # WORDS TO MOVE 

1$: MFPD (R2)+ > GET A WORD FROM USER'S CHAIN DATA AREA 

MOV <SP)+, (R3)+ iMOVE TO CONTEXT BLOCK AREA 

SOB R4, 1* 

CALL STOP ;EXIT TO KMON TO DO .CHAIN 

. SBTTL . RCTRLO 

PROCESS THE . RCTRLO EMT 

OOOOOOG RCTRLO: BIT #*CFOPNi LSW4 (Rl > > Is input coming from a command file? 

RCTOCF === . -TSEM2 

BNE 1* ;Br if yes — Don't reset ctrl-0 

OOOOOOG BIC #*CTRLO, LSW3<R1>; Reset Ctrl-Q flag 

1*: JMP EMTXIT 



004737 
000400 



000000G 



TSEM2 TSX-Plus EMT Overlay 
. HRESET 



1 

2 

3 

4 

5 

6 

7 003416 

8 

9 
10 
11 
12 

13 003420 
14 
15 
16 

17 003420 
18 
19 
20 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 15 



SBTTL . HRESET 



005061 OOOOOOG 



003424 004737 005062 ' 



c 

22 

23 

24 

25 003430 

26 

27 

28 

29 003436 

30 003442 

31 003444 
32 

33 
34 

35 003452 

36 003456 

37 003462 

38 003464 

39 003472 

40 003474 

41 003504 

42 003506 
43 

44 
45 

46 003510 

47 003514 



005737 
001403 



OOOOOOG 



012702 
020227 
001004 
032761 
001004 

005302 
002363 



005037 
000137 



Process the . HRESET EMT 

(Halt all I/O for job and then purge all I/O channels) 



HRESET: CALL 
BR 



IOHALT 
SRESET 



;HALT ALL I/O FOR JOB 
; NOW DO . SRESET 



. SBTTL . SRESET 



PROCESS THE . SRESET AND . HRESET EMTS. 
SRESET: 

Reset . SPND/. RSUli counter for job 

CLR LSPND<R1) i RESET .SPND COUNT FOR JOB 
Cancel any pending . MRKT requests 

CALL CANMKT J CANCEL PENDING MARK-TIME REQUESTS 

Cancel any job monitoring requests 

OCALL MONABT ; Cancel any job monitoring 

Cancel any message-read completion routine requests 



TST 


VMAXMC 


BEG. 


4* 


OCALL 


MSGABT 



Purge I/O channels 



177777G 
000017 

OOOOOOG OOOOOOG 



4*: 
1*: 



2*: 
3*: 



OOOOOOG 
OOOOOOG 





MOV 


#NUCHN-1,R2 




CMP 


R2, #17 




BNE 


2* 




BIT 


#OVLBIT> LJSW<R1) 




BNE 


3* 




. PURGE 


R2 




DEC 


R2 




BGE 


1* 


Undo 


. CDFN 






CLR 


UCHAN 




JMP 


EMTXIT 



; Is message support genned in? 

; Br if not 

> Abort any message-read cpl routines 



GET HIGHEST USER CHANNEL # 

IS THIS CHANNEL 17? 

BR IF NOT 

IS THE PROGRAM OVERLAYED? 

IF IT IS, DON'T CLOSE CHANNEL 17 

PURGE EACH ONE 



i RESET USER CHANNEL DEFINITIONS 



TSEM2 TSX-Plus EMT Overlay 
. SAVESTATUS 



MACRO V05. 05 Wednesday lS-Jan-89 10:37 Page 16 



003520 
003524 
003532 



1 
2 
3 
4 
5 
6 
7 
8 
9 003534 

10 003542 

11 003544 

12 003550 
13 

14 

15 

16 003554 

17 

18 

19 

20 003560 

21 003564 

22 003566 
23 

24 
25 

26 003572 

27 003574 

28 003600 

29 003604 

30 003610 

31 003612 

32 003614 
33 

34 
35 

36 003616 

37 003624 

38 003626 

39 003632 

40 003636 

41 003640 
42 



SBTTL . SAVESTATUS 



013703 
032763 
001417 

032763 
001404 
012700 
000137 



OOOOOOG 
OOOOOOG 



OOOOOOG 



004737 OOOOOOG 



> Save channel status. 

SVSTAT: MOV CHNADR, R3 i GET ADDRESS OF CHANNEL BLOCK 

BIT #CS*QPN>C. CSW<R3>; IS THE CHANNEL OPEN? 

BEG 4* i BR IF NOT OPEN NOW 

; Make sure file was opened with a lookup. 

OOOOOOG OOOOOOG BIT #CS*ENT, C. CSW<R3) ; OPENED WITH LOOKUP OR ENTER? 

BEQ 2* > BR IF LOOKUP 

MOV #1,R0 j RETURN ERROR CODE 1 

JMP SETERR 

i 

; Wait for any I/O activity on the channel to finish 

> 

2*: CALL IOWAIT > WAIT FOR I/O TO FINISH 

> Tell TSX shared file logic that savestatus is being done 



000001 
OOOOOOG 



005737 
001402 
004777 



010301 
013700 
004737 
012704 
012346 
106620 
077403 



032761 
001404 
005061 
000137 
005000 
000137 



OOOOOOG 
OOOOOOG 



TST 


JCDB 


BEG 


4* 


CALL 


©SFSVST 



i Any shared file channels open for job? 

iBr if not 

i TELL SHARED FILE SYSTEM 



Move channel block to user's area 



000002G 
OOOOOOG 
000005 



4*: 



3*: 



MOV 


R3, Rl 


MOV 


EMTBLK+2, RO 


CALL 


VALADW 


MOV 


#5, R4 


MOV 


<R3)+, -<SP) 


MTPD 


<R0) + 


SOB 


R4, 3* 



SAVE ADDRESS OF CHANNEL AREA 
GET ADDRESS OF USER'S SAVE AREA 
VALIDATE THE ADDRESS 
GET # WORDS TO MOVE 
MOVE DATA TO USER'S AREA 



Mark channel as closed 



OOOOOOG OOOOOOG 

OOOOOOG 
OOOOOOG 

OOOOOOG 



5*: 



BIT 
BEG 
CLR 
JMP 
CLR 
JMP 



#CS*OPN, C. CSW(Rl); IS THE CHANNEL OPEN? 



5* 

C. CSW<R1) 

EMTXIT 

RO 

SETERR 



BR IF CHANNEL IS NOT OPEN 

PURGE THE CHANNEL 

FINISHED 

RETURN ERROR CODE OF IF CHANNEL CLOSED 



TSEM2 TSX-Plus EMT Overlay 
. REOPEN 



MACRO V05. 05 Wednesday 18-Jan~89 10:37 Page 17 



003644 013703 OOOOOOG 



032763 OOOOOOG OOOOOOG 

001403 

005000 

000137 OOOOOOG 



3 
4 
5 
6 
7 
8 
9 003650 

10 003656 

11 003660 

12 003662 
13 

14 
15 

16 003666 

17 003672 

18 003676 

19 003702 

20 003704 

21 003706 
22 

23 
24 

25 003710 

26 003714 

27 003720 

28 003724 

29 003726 

30 003732 

31 003734 

32 003740 

33 003746 

34 003750 

35 003754 

36 003760 
37 

38 
39 

40 003762 

41 003766 

42 003770 
43 

44 

45 

46 003774 

47 

48 

49 

50 

51 004000 

52 004004 

53 004010 



013700 
004737 
012704 
106520 
012623 
077403 



013703 
016300 
032700 
001425 
032700 
001022 
105063 
126327 
101014 
042700 
020037 
101007 



005737 
001402 
004777 



000002G 
OOOOOOG 
000005 



OOOOOOG 
OOOOOOG 
OOOOOOG 

OOOOOOG 

OOOOOOG 
OOOOOOG 

OOOOOOC 
OOOOOOG 



000007 



OOOOOOG 
OOOOOOG 



000137 OOOOOOG 



005063 OOOOOOG 
012700 000001 
000137 OOOOOOG 



. SBTTL . REOPEN 

Reopen a channel using saved status information. 

REOPEN: MOV CHNADR, R3 > GET ADDRESS OF CHANNEL BLOCK 

Make sure channel is not now open. 

BIT #CS*OPN, C. CSW<R3); IS CHANNEL OPEN NOW? 

BEG. 1* iBR IF NOT 

CLR RO ; RETURN ERROR CODE OF 

JMP SETERR 

Channel is closed. Restore status. 

1*: MOV EMTBLK+2, RO ; GET ADDRESS OF USER'S SAVE STATUS BLOCK 

VALIDATE THE ADDRESS 

GET # WORDS TO MOVE 
f«J: MFPD <R0)+ J GET A WORD FROM USER'S AREA 

MOVE INTO CHANNEL BLOCK 

MOVE ALL 

Check consistency of savestatus information that uie restored. 

POINT TO CHANNEL BLOCK 

GET CHANNEL STATUS WORD <CSW) 

CHANNEL SHOULD BE OPEN NOW 

ERROR IF NOT 

CHANNEL SHOULD HAVE BEEN OPENED VIA LOOKUP 

ERROR IF NOT 

THERE SHOULD BE NO ACTIVE I/O OPERATIONS 

CHECK VALIDITY OF UNIT NUMBER 

ERROR IF TOO BIG 

GET DEVICE INDEX NUMBER 

MAKE SURE IT IS A VALID NUMBER 

BR IF TOO BIG 



MOV 


EMTBLK+2, RO ; 


CALL 


VALADW J 


MOV 


#5, R4 ; 


MFPD 


<R0)+ > 


MOV 


<SP>+, <R3>+ ; 


SOB 


R4> 3* i 



MOV 


CHNADR, R3 


MOV 


C. CSW<R3), RO 


BIT 


#CS*QPN, RO 


BEQ 


9* 


BIT 


#CS*ENT, RO 


BNE 


9* 


CLRB 


C. NUMQ<R3) 


CMPB 


C. DEVGKR3), #7 


BHI 


9* 


BIC 


# A C<CS*NMX>, RO 


CMP 


RO, NUMDEV 


BHI 


9* 



Tell shared file system about the reopen. 



4*: 



TST 


JCDB 


BEQ 


4* 


CALL 


©SFRSST 


Finished 




JMP 


EMTXIT 



i Does job have any shared file channels? 

; Br if not 

» WE MAY BE REOPENING A SHARED FILE 



Error — Savestatus info we restored was invalid. 
Return error code of 1. 



9$: 



CLR 


C. CSW<R3) 


MOV 


#1* RO 


JMP 


SETERR 



i PURGE THE CHANNEL 
i RETURN ERROR CODE 1 



TSEM2 
. PURGE 



TSX-Plus EMT Overlay 



MACRO V05. 05 Wednesday 18-Jan~B9 10:37 Page IS 



1 

2 

3 

4 

5 

6 

7 

8 

9 

10 

11 

12 

13 

14 

15 

16 

17 

18 

19 

20 

21 

22 

23 

24 

25 

26 

27 

28 

29 

30 

31 

32 

33 

34 

35 

36 

37 

38 



004014 
004020 
004026 
004030 
004034 
004040 
004044 
004046 
004054 
004060 
004062 



004066 
004072 
004076 
004104 
004106 
004112 
004114 
004120 



004124 
004130 
004132 



013703 
032763 
001434 
004737 
113701 
105737 
001403 

005737 
001402 
004777 



016300 
042700 
032760 
001405 
005737 
001002 
000137 
005063 



113700 
001402 
000137 



OOOOOOG 
OOOOOOG OOOOOOG 

OOOOOOG 
OOOOOOG 
OOOOOOG 



OOOOOOG 
OOOOOOG 



. SBTTL . PURGE 

• __— . — — — -.«,«. ___ — „._ — —. — —._..-_—. — — — — ._ . — — — . — — — — —.— — —. — — —.—. — «_ — — . — —_-._ — — — — — — — —— — —.«■■»_ — —. — -««»*». 

; Purge a channel. 
> 

PURGE: MOV CHNADRi R3 ; GET ADDRESS OF CHANNEL BLOCK 

#CS*OPN, C. CSW<R3>; IS THE CHANNEL OPEN NOW? 

i BR IF NOT OPEN 

; WAIT FOR I/O ON CHANNEL TO FINISH 

i GET CHANNEL NUMBER 

>Are there any spooled devices? 

» BR IF NOT 

; SEE IF THIS IS A SPOOLED DEVICE 
?*: TST JCDB i Does job have any shared file channels? 

> Br if not 

i SEE IF IT IS A SHARED FILE 

If tue are purging a channel opened to a mag tape and I/O abort 
entry point code is turned off* then treat the purge like a close. 



MOV 


CHNADR, R3 


BIT 


#CS*OPN, C 


BEG 


1* 


CALL 


IOWAIT 


MOVB 


CHNNUM, Rl 


TSTB 


NSPLDV 


BEQ 


2* 


OCALL 


SDCLOS 


TST 


JCDB 


BEQ 


4* 


CALL 


eSFCLS 



OOOOOOG 

ooooooc 

OOOOOOG OOOOOOG 

OOOOOOG 

OOOOOOG 
OOOOOOG 



OOOOOOG 
OOOOOOG 



4*: 



1*: 



MOV 
BIC 
BIT 
BEG 
TST 
BNE 
JMP 
CLR 



C. CSW<R3),R0 J GET CHANNEL STATUS WORD 
#"C<CS*NMX>>RO ;MASK OUT ALL BUT DEVICE INDEX NUMBER 
#DS*NRD, DVSTAT<RO); IS DEVICE A MAGNETIC TAPE? 



1* 

IOABFL 

1* 

CLOSE 

C. CSW<R3) 



BR IF NOT 

IS 10 ABORT IN EFFECT? 

BR IF YES 

TREAT PURGE ON MAG TAPE LIKE CLOSE 

MARK CHANNEL AS CLOSED 



See if me need to report an error from . CLOSZ 



MOVB 

BEQ 

JMP 



CLZERR, RO 

3* 

SETERR 



004136 000137 OOOOOOG 



Succesful completion 
3*: JMP EMTXIT 



i Do we need to report .CLOSZ error? 

* Br if not 

i And report to user 



; If no errors* done 



€ 



t 

€ 



TSEM2 TSX-Plus EMT Overlay 
. CLOSZ 



1 
2 
3 
4 
5 
6 
7 
8 
9 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 19 



004142 013703 OOOOOOG 



. SBTTL . CLOSZ 
; .CLOSZ — Close a file at a specified size 
CLOSZ: MOV CHNADR, R3 > Get address of channel 
; Make sure channel is open 



004146 

10 004154 

11 004156 
12 

13 
14 

15 004162 

16 004170 

17 004172 

18 004200 
19 

20 
21 

22 004204 

23 004210 

24 004214 

25 004216 

26 004222 

27 004224 

28 004232 



032763 
001002 
000137 



032763 
001005 
112737 
000137 



013700 
020063 
101003 
010063 
000403 
1 1 2737 
000137 



OOOOOOG OOOOOOG 
OOOOOOG 

OOOOOOG OOOOOOG 1*: 

000002 OOOOOOG 
004014' 



BIT #CS*QPN, C. CSW(R3> i Is the channel open? 

BNE 1* * Br if so 

JMP EMTXIT i If not, ignore request 

Channel must have been opened tuith . ENTER 

BIT #CS*ENT, C. C5W<R3> » Was it opened with a .ENTER? 

BNE 2* 'Br if yes 

MOVB #EC2, CLZERR ;If not, report error and just purge 

JMP PURGE J Go do purge 



Specified size must not exceed size of file when created 



000002G 
OOOOOOG 

OOOOOOG 

000001 
OOOOOOG 



2*: 



OOOOOOG 3*: 
4*: 



MOV 


EMTBLK+2, RO 


CMP 


RO, C. LENG<R3) 


BHI 


3* 


MOV 


RO, C. USED<R3> 


BR 


4* 


MOVB 


#EC1, CLZERR 


JMP 


CLOSE 



Get requested size 

Is it within valid range? 

Br if specified size beyond end of file 

If OK, make sure .CLOSE uses specified size 

and go do close 

If too big, keep C. USED and report error 

Go do close 



i 
i 

I 
t 
i 
i 
t 

4 

I 

< 

i 

i 

i 

4 

I 

4 

i 

i 
i 
i 

i 
i 



TSEM2 
. WAIT 



TSX~Plus EMT Overlay 



3 

4 

5 

6 

7 

8 

9 

10 

11 

12 

13 

14 

15 

16 

17 

18 

19 

20 

21 

22 

23 

24 

25 

26 

27 

28 



004236 013703 OOOOOOG 



MACRO V05. 05 Wednesday i8~Jan-89 10:37 Page 20 

. SBTTL . WAIT 
.WAIT — Wait for all I/O to finish on a channel. 
DOWAIT: MOV CHNADR, R3 ; GET ADDRESS OF CHANNEL 
Make sure channel is open 



004242 
004250 
004252 
004254 



032763 
001003 
005000 
000137 



OOOOOOG OOOOOOG 



OOOOOOG 



BIT 
BNE 
CLR 
JMP 



#CS*OPN> C. C5W<R3); IS THE CHANNEL OPEN? 



1* 
RO 
SETERR 



; BR IF YES 

; RETURN ERROR CODE OF O IF NOT OPEN 



004260 004737 OOOOOOG 



Wait for all I/O to finish 
1$: CALL IOWAIT 

Check for hardware errors 



;WAIT FOR I/O TO FINISH 



004264 
004272 
004274 
004302 
004306 



032763 
001407 
042763 
012700 
000137 



OOOOOOG OOOOOOG 

OOOOOOG OOOOOOG 

000001 

OOOOOOG 



004312 000137 OOOOOOG 



BIT 
BEQ 
BIC 
MOV 
JMP 

Finished 

9*: JMP 



#CS*ERR,C. CSW<R3);DID A HARD ERROR OCCUR? 

9* ; BR IF NOT 

#CS*ERR, C. CSW<R3>; CLEAR THE ERROR FLAG IN THE CSW 

#1,R0 > Return error code 1 

SETERR 



EMTXIT 



; RETURN 



TSEM2 


TSX-Plus EMT Ov 


erlay 


. GTIM 








1 
2 








3 








4 








5 


004316 


013700 


000002G 


6 


004322 


004737 


OOOOOOG 


7 


004326 


013746 


OOOOOOG 


8 


004332 


106620 




9 


004334 


013746 


OOOOOOG 


10 


004340 


106610 




11 


004342 


000403 




12 








13 








14 








15 








16 








17 


004344 


013737 


OOOOOOG 


IS 








19 


004352 


013702 


OOOOOOG 


20 


004356 


013762 


OOOOOOG 


21 


004364 


000137 


OOOOOOG 


22 








23 








24 








25 








26 








27 


004370 


032737 


OOOOOOG 


28 


004376 


001003 




29 


004400 


005000 




30 


004402 


000137 


OOOOOOG 


31 








32 








33 








34 


004406 


013702 


000002G 


35 


004412 


010200 




36 


004414 


004737 


OOOOOOG 


37 


004420 


106522 




38 


004422 


012600 




39 


004424 


002402 




40 


004426 


010037 


OOOOOOG 


41 








42 








43 








44 


004432 


106522 




45 


004434 


012600 




46 


004436 


002405 




47 


004440 


010037 


OOOOOOG 


48 


004444 


106522 




49 


004446 


012637 


OOOOOOG 


50 








51 








52 








53 


004452 


000137 


OOOOOOG 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 



SBTTL . GTIM 



Page 21 



> Get time of 


day. 


GETTIM: MOV 


EMTBLK+2, RO 


CALL 


VALADW 


MOV 


SYTIMH, -<SP> 


MTPD 


(R0) + 


MOV 


SYTIML, -(SP) 


MTPD 


(RO) 


BR 


UPDATE 



;GET ADDR OF USER'S TIME BUFFER 
; VALIDATE THE ADDRESS 
; RETURN HIGH-ORDER TIME 

; RETURN LOW-ORDER TIME 

;G0 UPDATE DATE CELL 



SBTTL 



DATE 



Get current date (return to user in RO). 

OOOOOOG DATE: MOV SYSDAT, URO > RETURN DATE TO USER IN RO 

; Move current date value to cell in user's simulated monitor vector tabl( 

UPDATE: MOV CXTRMN, R2 > GET BASE ADDRESS OF JOB VECTOR 

OOOOOOG MOV SYSDAT, R*DATE(R2); SET DATE VALUE 

JMP EMTXIT 

. SBTTL . SDTTM 



. SDTTM 



Set system date and time. 



OOOOOOG SDTTM: 



BIT 
BNE 
CLR 
JMP 



Set date 

1*: MOV 
MOV 
CALL 
MFPD 
MOV 
BLT 
MOV 

Set time 



2$: MFPD 
MOV 
BLT 
MOV 
MFPD 
MOV 

Fini shed 

3*: JMP 



#PO*OPR,PRIVCO 

1* 

RO 

SETERR 



EMTBLK+2, R2 

R2, RO 

VALADW 

(R2) + 

(SP)+, RO 

2* 

RO, SYSDAT 



(R2) + 

(SP)+, RO 

3* 

RO, SYTIMH 

(R2) + 

(SP)+, SYTIML 



EMTXIT 



IS THIS A PRIVILEGED USER RUNNING? 

BR IF YES 

RETURN ERROR CODE 



;GET ADDRESS OF DATE/TIME VALUE BLOCK 
i VALIDATE THE ADDRESS 

i GET NEW DATE VALUE 

; IF NEGATIVE THEN DON'T CHANGE DATE 
> SET NEW SYSTEM DATE 



; GET HIGH-ORDER TIME VALUE 

; IF NEGATIVE, DON'T CHANGE TIME VALUE 
;SET NEW HIGH-ORDER TIME VALUE 
» GET NEW LOW-ORDER TIME VALUE 
> SET LOW-ORDER TIME VALUE 



TSEM2 


TSX-Plus EMT Dv 


er lay 


. TWAIT 








1 

2 








3 








4 








5 


004456 


013700 


000002G 


6 


004462 


004737 


0000000 


7 


004466 


106520 




8 


004470 


012661 


0000000 


9 


004474 


106510 




10 


004476 


012661 


000000G 


11 








12 








13 








14 


004502 


004737 


OOOOOOG 


15 


004506 


005761 


OOOOOOG 


16 


004512 


002411 




17 


004514 


003003 




IS 


004516 


005761 


OOOOOOG 


19 


004522 


001405 




20 


004524 


012700 


OOOOOOG 


21 


004530 


004737 


OOOOOOG 


22 


004534 


000762 




23 








24 








25 








26 


004536 


000137 


OOOOOOG 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 22 

. SBTTL . TWAIT 
Do a timed wait 



TIMWAT: MOV 
CALL 
MFPD 
MOV 
MFPD 
MOV 



EMTBLK+2, RO ; GET POINTER TO TIME VALUE BLOCK 

VALADW ; VALIDATE THE ADDRESS 

(R0)+ i GET HIGH-ORDER TIME VALUE 

<SP)+, LSLEPH(Rl) 

<R0) iGET LOW-ORDER TIME VALUE 

(SP)+, LSLEPL(Rl) 



Suspend job for timed interval 



1*: 



CALL 


CHKABT 


TST 


LSLEPH(Rl) 


BLT 


3* 


BGT 


2* 


TST 


LSLEPL<R1) 


BEQ 


3* 


MOV 


#S*TMWT, RO 


CALL 


QHDSPN 


BR 


1* 



2$: 



Timed wait is finished 
3$: JMP EMTXIT 



MAKE SURE WE HAVEN'T BEEN ABORTED 

IS THERE STILL SOME SLEEP TIME LEFT1 

BR IF NOT (TIME HAS GONE NEGATIVE) 

BR IF SOME TIME LEFT 

CHECK LOW-ORDER VALUE 

BR IF TIME IS UP 

STATE BECOMES TIMED WAIT 

SUSPEND THE JOB 



TSEM2 


TSX-Plus EMT Ov 


erlay MACRO V 


. MRKT 








1 
2 








3 








4 








5 


004542 






6 








7 








B 








9 


004542 


004737 


OOOOOOG 


10 








11 








12 








13 








14 


004546 


113761 


OOOOOOG OOOOOOG 


15 








16 


004554 


013700 


000002G 


17 


004560 


004737 


OOOOOOG 


IS 


004564 


103440 




19 


004566 


106520 




20 


004570 


012661 


OOOOOOG 


21 


004574 


106510 




22 


004576 


012661 


OOOOOOG 


23 








24 


004602 


013700 


000004G 


25 


004606 


004737 


OOOOOOG 


26 


004612 


103425 




27 


004614 


010061 


OOOOOOG 


28 








29 


004620 


013761 


OOOOOOG OOOOOOG 


30 








31 


004626 


013761 


000006G OOOOOOG 


32 








33 








34 








35 


004634 






36 


004642 


013761 


OOOOOOG OOOOOOG 


37 


004650 


010137 


OOOOOOG 


38 


004654 






39 








40 








41 








42 


004662 


000137 


OOOOOOG 


43 








44 








45 








46 


004666 


004737 


OOOOOOG 


47 


004672 


012700 


177766 


48 


004676 


000137 


OOOOOOG 



MACRO V05. 05 Wednesday 18-Jan-S9 10: 3: 

. SBTTL . MRKT 
/ Start a mark -time request. 

i 

MRKT: 

i Get an I/O queue entry. 
j 

CALL GETQ 



Page 2: 



; GET A FREE I /O QUEUE ELEMENT 



Set up the queue element as a completion queue element. 
<R1 = Address of queue element) 

MOVB C0RUSR,CQ*J0B<R1);SET JOB # IN QUEUE ELEMENT 

Set time value. 

MOV EMTBLK+2, RO i GET ADDRESS OF TIME VALUE ARG BLOCK 

CALL UACHKW ; MAKE SURE ADDRESS IS LEGAL 

BCS 9* ;BR IF INVALID ADDRESS 

MFPD <R0) + iGET HIGH-ORDER TIME VALUE 

MOV <SP)+, CG*HQT<R1);SET HIGH-ORDER TIME VALUE 

MFPD (RO) -GET LOW-ORDER TIME VALUE 

MOV (SP)+, CQ*L0T<R1) 

Set address of completion routine 

MOV EMTBLK+4, RO i GET ADDRESS OF COMPLETION ROUTINE 

CALL UACHKW J MAKE SURE ADDRESS IS LEGAL 

BCS 9* >BR IF NOT LEGAL 

MOV RO, CQ*RTN<Ri) ; SET ADDRESS OF COMPLETION ROUTINE 

Set mapping for kernel PAR 5 that was in effect when EMT was executed. 
MOV EMTMAP,CQ*PA5<R1); SET EMT ENTRY MAPPING FOR PAR 5 

Set ID number 

MOV EMTBLK+6, CQ*R0<R1); SET COMPLETION ID NUMBER 

Add queue entry to mark-time list. 

DISABL ; ** DISABLE ** 

MOV MRKTHD, CQ*LNK<R1 ); ADD TO FRONT OF LIST 

MOV R 1 , MRKTHD 

ENABL i ** ENABLE ## 

Fini shed 

JMP EMTXIT 

Error — Invalid address in MRKT argument list. 



9*: 



CALL 


QFREE 


MOV 


#-12, RO 


JMP 


SETERR 



; RELEASE THE QUEUE ELEMENT 
> RETURN ERROR CODE 
; ABORT EMT 



TSEH2 
. CHKT 



TSX-Plus EMT Overlay 



004702 
004704 
004710 



1 
2 
3 
4 
5 
6 
7 
8 
9 
10 

11 004712 

12 004716 

13 004724 

14 004730 

15 004732 

16 004736 

17 004740 
IS 004746 

19 004750 

20 004754 

21 004756 

22 004760 
23 

24 
25 

26 004762 

27 004770 
28 

29 
30 

31 004776 

32 005002 

33 005004 

34 005010 

35 005012 

36 005016 

37 005020 

38 005024 
39 

40 

41 

42 005026 

43 

44 

45 

46 005032 

47 

48 

49 

50 005036 

51 005044 

52 005046 
53 

54 
55 

56 005052 

57 005056 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 24 

. SBTTL . CMKT 
Cancel mark-time request. 



010103 
013702 
001460 



012704 

016401 
001442 
120361 
001007 
132761 
001003 
020261 
001402 
010104 
000761 



0000020 



CMKT: MOV R1,R3 

MOV EMTBLK+2, R2 
33EQ 1* 



COPY JOB INDEX # 

GET ID VALUE 

BR IF WE SHOULD CANCEL ALL REQUESTS FOR JOB 



Cancel a specifiec mark-time request for this job. 



OOOOOOC 
0000000 
0000000 

OOOOOOC OOOOOOG 
OOOOOOG 



4*: 



2*: 



MOV 


#MRKTHD-CQ*LN 


DISABL 




MOV 


CQ*LNK<R4),R1 


BEG 


5* 


CMPB 


R3, CQ*J0B<R1) 


BNE 


2* 


BITB 


#QF*IOT>CQ*FL 


BNE 


2* 


CMP 


R2, CQ*R0<R1> 


BEQ 


3* 


MOV 


Rl, R4 


BR 


4* 



Found specified queue entry 



#* DISABLE #* 

GET ADDRESS OF NEXT MARK-TIME QUEUE ENTRY 

BR IF REACHED END OF LIST 

DOES THIS ENTRY BELONG TO OUR JOB? 

BR IF NOT 

); IS THIS A . TIMIO ENTRY? 

BR IF YES 

DO ID NUMBERS MATCH? 

BR IF YES — FOUND ENTRY TO DELETE 

CHAIN FORWARD TO NEXT ENTRY IN LIST 



delete from list. 



016164 OOOOOOG OOOOOOG 3*: 



MOV CQ*LNK<R1),CG*LNK<R4>; RELINK LIST AROUND US 
ENABL i ** ENABLE ** 

See if we need to return remaining time. 



013700 
001411 
004737 
103406 
016146 
106620 
016146 
106610 



000004G 
OOOOOOG 
OOOOOOG 
OOOOOOG 



DOES USER WANT REMAINING TIME? 

BR IF NOT 

MAKE SURE RECIEVING AREA IS LEGAL 

BR IF NOT LEGAL 

RETURN HIGH-ORDER TIME 



004737 OOOOOOG 



000137 OOOOOOG 



MOV EMTBLK+4, RO 

BEQ 6* 

CALL UACHKW 

BCS 6* 

MOV CG*H0T(R1),-<SP> 

MTPD (R0)+ 

MOV CQ*L0T(R1),-<SP>; RETURN LOW-ORDER TIME 

MTPD <R0) 

Return queue element to free list. 

6*: CALL QFREE i FREE THE Q ELEMENT 

Finished 

JMP EMTXIT 

Could not find specified queue element — return error code 0. 



5*: 



005000 

000137 OOOOOOG 



004737 005062 ' 
000137 OOOOOOG 



ENABL 

CLR 

JMP 



RO 
SETERR 



i ## ENABLE *# 

; RETURN ERROR CODE 



Cancel all mark-time requests for this job. 



1*: 



CALL 
JMP 



CANMKT 
EMTXIT 



; CANCEL ALL MARK-TIME REQUESTS FOR JOB 
; FINISHED 



TSEM2 
. CMKT 



TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-S? 10: 37 Page 25 



1 

2 

3 

4 

5 

6 

7 

8 

9 

10 

11 

12 

13 

14 

15 

16 

17 

18 

19 

20 

21 

22 

23 

24 

25 

26 

27 

28 

29 

30 

31 



005062 
005064 
005066 
005072 
005100 
005104 
005106 
005114 
005116 
005124 
005126 
005134 
005142 
005146 
005150 
005152 



005154 
005162 
005164 
005166 



010146 
010446 
012704 

016401 
001423 
123761 
001015 
132761 
001011 
016164 

004737 
000747 
010104 
000752 



012604 
012601 
000207 



CANMKT is called to cancel all mark-time requests for the current job. 
It is called when a .CMKT EMT is done with an id of or when a job 
ex its. 



; Inputs: 
; MRKTHD = 

CANMKT: MOV 
MOV 



Head of mark-time queue chain. 



000000C 
0000000 
OOOOOOG 
0000000 
OOOOOOG 
OOOOOOG 



1*: 
2*: 



OOOOOOG 
OOOOOOG 
OOOOOOG 



3*: 



MOV 

DISABL 

MOV 

BEQ 

CMPB 

BNE 

BITB 

BNE 

MOV 

ENABL 

CALL 

BR 

MOV 

BR 



Finished 



4*: 



ENABL 
MOV 
MOV 
RETURN 



Rl, -<SP) 
R4,-<SP> 
#MRKTHD-CQ*LNK, R4; DUMMY POINTER TO LIST HEAD 

;#* DISABLE #* 
CQ*LNK(R4>,R1 i GET NEXT ENTRY IN LIST 
4* ;BR IF REACHED END OF LIST 

CORUSR,CG*JOB<Ri>i IS THIS ENTRY FOR THIS JOB? 
3* i BR IF NOT 

#QF*IOT, CQ*FLG<R1>; IS THIS A HANDLER . TIMIO ENTRY? 
3* >BR IF YES 

CQ*LNK<R1),CG*LNK<R4>; RELINK LIST AROUND US 

; ** ENABLE ** 

i RETURN QUEUE ELEMENT TO FREE LIST 



GFREE 
1* 

Rl, R4 
2* 



j LINK TO NEXT ELEMENT IN LIST 



; ** ENABLE ** 



<SP)+>R4 
(SP)+, Rl 



i 
I 

« 
< 

« 

€ 

< 
i 
i 
< 

€ 



TSEM2 TSX-Plus EMT Overlay 
. CSTAT 



1 
2 
3 
4 
5 
6 
7 
8 
9 



005170 013703 OOOOOOG 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 26 

. SBTTL . CSTAT 
Return channel status 
CHSTAT: MOV CHNADR, R3 > GET ADDRESS OF CHANNEL BLOCK 
Make sure channel is open or at least has device index 



005174 

10 005202 

11 005204 

12 005212 
13 

14 
15 
16 

17 005214 

18 005220 

19 005222 
20 

21 005226 

23 005232 

24 005236 



032763 0000000 

001004 

032763 OOOOOOG 

001444 



OOOOOOG 
OOOOOOG 



005240 
005244 



26 
27 
28 

29 005246 

30 005252 
31 

32 005254 

33 005260 
34 

35 005262 

36 005264 

37 005270 
38 

39 005272 

40 005276 

41 005302 

42 005306 
43 

44 
45 

46 005310 

47 005316 
48 

49 

50 

51 005320 

52 

53 

54 

55 005324 

56 005326 
57 



013704 
010400 
004737 

010437 

016346 
106624 

016346 
106624 

016346 
106624 

016346 
106624 

005046 
116316 
106624 

016301 
042701 
016146 
106624 



032763 
001402 



000002G 
OOOOOOG 
OOOOOOG 
OOOOOOG 

OOOOOOG 

OOOOOOG 

OOOOOOG 

OOOOOOG 



OOOOOOG 

177701 

OOOOOOG 



OOOOOOG OOOOOOG 



000137 OOOOOOG 



BIT #CS*OPN, C. CSW(R3>; IS THE CHANNEL OPEN? 

BNE 1* ; BR IF YES 

BIT #CS*NMX,C. CSW<R3> ; IS THERE ANY DEVICE INFORMATION? 

BEG. 7* i IMMEDIATE ERROR EXIT IF NOT 

Channel is open. Return status. 

Also if there is device information available, but then return error. 



;GET ADDRESS OF USER'S STATUS BLOCK 
; VALIDATE ADDRESS 



1*: MOV EMTBLK+2, R4 
MOV R4, RO 
CALL VALADW 

> Point RO to user's channel status block passed in EMT argument 

MOV R4> URO ; Point RO to channel status block 

; Return CSW 

MOV C. CSW(R3), ~<SP> 

MTPD ( R4 ) + 
; Return starting block number of file 

MOV C. SBLK(R3), -<SP) 

MTPD <R4)+ 
.= Return allocated length of file. 

MOV C. LENG(R3)» -<SP> 

MTPD <R4)+ 
; Return highest block number written so far 

MOV C. USED<R3),~<SP> 

MTPD <R4>+ 

> Return device unit number. 

CLR -<SP> ; ENSURE HIGH BYTE IS CLEAR 

MOVB C. DEVQ<R3), <SP) ; MOVE UNIT NUMBER INTO LOW BYTE 
MTPD (R4)+ 
; Return RadSO device name. 

MOV C. CSW<R3),R1 > GET DEVICE TABLE # 
BIC #~C76, Rl iGET DEV # ONLY 
MOV PNAME(Rl), -<SP) i GET RAD50 DEVICE NAME 
MTPD (R4)+ 

Normal or error return? 

BIT #CS*OPN, C. CSW(R3> ; IS CHANNEL OPEN? 
BEG 7% ; ERROR RETURN IF NOT 

Normal exit 

JMP EMTXIT 

Error return 



i 

I 

4 
I 

i 
i 
( 

i 



005000 
000137 



7*: 



OOOOOOG 



CLR 
JMP 



RO 
SETERR 



; RETURN ERROR CODE OF 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan--89 10:37 Page 26-1 
. CSTAT 

58 

59 . SBTTL . CDFN 

60 i 

61 ; Define channels. 

62 ; 

63 005332 013737 000002G OOOOOOG CDFN: MOV EMTBLK+2, UCHAN J SAVE ADDRESS OF USER CHANNEL SPACE 

64 005340 000137 OOOOOOG JMP EMTXIT 



< 

< 
< 
i 

i 

4 
I 
i 

i 

< 

( 
« 

€ 

< 
< 
i 
I 
I 
I 
i 



TSEM2 


TSX-Plus EMT Ov 


erlay MACRO V 


< . GVAL 








1 
< 2 








3 








4 








* 5 


005344 


113700 


OOOOOOG 


6 


005350 


120027 


000003 


7 


005354 


101404 




< 8 


005356 


012700 


177767 


9 


005362 


000137 


OOOOOOG 


10 


005366 


006300 




* 11 


005370 


013702 


000002G 


12 


005374 


013703 


000004G 


13 


005400 


000170 


006226 ' 


( 14 








15 








16 








( 17 


005404 


032702 


000001 


18 


005410 


001005 




19 


005412 


005702 




1 20 


005414 


002427 




21 


005416 


020227 


OOOOOOG 


22 


005422 


103403 




1 23 


005424 


005000 




24 


005426 


000137 


OOOOOOG 


25 


005432 


013700 


OOOOOOG 


C 26 


005436 


005060 


OOOOOOG 


27 


005442 


005737 


OOOOOOG 


28 


005446 


001403 




i 29 


005450 


052760 


OOOOOOG OOOOOOG 


30 


005456 


063702 


OOOOOOG 


31 


005462 


016237 


000002 OOOOOOG 


i 32 


005470 


000137 


OOOOOOG 


33 








34 








< 35 








36 


005474 


005402 




37 


005476 


020227 


000042 


< 38 


005502 


101403 




39 


005504 


005000 




40 


005506 


000137 


OOOOOOG 


i 41 


005512 


005000 




42 


005514 


016202 


005530' 


43 


005520 


004712 




< 44 


005522 


010037 


OOOOOOG 


45 


005526 


000137 


OOOOOOG 


46 








i 47 








48 








49 




005530' 




* 50 


005532 


005574 ' 




51 


005534 


005602' 




52 


005536 


005610' 




* 53 


005540 


005624' 




54 


005542 


005640' 




55 


005544 


005646' 




< 56 


005546 


005654' 




57 


005550 


005662' 





05 Wednesday 18-Jan~89 10:37 Page 2: 



. SBTTL 



GVAL 



. GVAL, . PVAL, . PEEK, . POKE 



GVAL: 



1*: 



MOVB 


EMTBLK, RO ; 


CMPB 


RO, #3 ; 


BLOS 


1* > 


MOV 


#-11, RO ; 


JMP 


SETERR 


ASL 


RO i 


MOV 


EMTBLK+2, R2 ; 


MOV 


EMTBLK+4, R3 > 


JMP 


@GVJMP(RO) ; 



GET SUB -FUNCTION CODE <. GVAL /.PVAL etc. ) 

MAKE SURE IT IS REASONABLE 

BR IF OK 

INVALID FUNCTION CODE 



GET 2 # FUNCTION CODE 

GET OFFSET VALUE 

GET VALUE TO STORE < . PVAL & 

JUMP TO PROCESSING ROUTINE 



POKE) 



GVAL — Get value from RMON table 



DOGVAL: 



2$: 
1*: 



3*: 



BIT #1,R2 

BNE 2* 

TST R2 

BLT TSXGVL 

CMP R2, #MAXGVL 

BLO 1* 

CLR RO 

JMP SETERR 

MOV CXTRMN, RO 

CLR R*CFST<RO) 

TST CFPNT 

BEQ 3* 

BIS #CFACFL, R*CFST 

ADD CXTRMN, R2 

MOV 2(R2),UR0 

JMP EMTXIT 



OFFSET CANNOT BE ODD 

BR IF ODD 

IS OFFSET VALUE NEGATIVE? 

IF YES THEN HE'S GETTING A TSX-PLUS VALUE 

IS IT TOO BIG? 

BR IF OK 

RETURN ERROR CODE OF 



; GET RMON OFFSET FOR CMD FILE STATUS WORD 
; CLEAR COMMAND FILE STATUS WORD 
; ARE COMMAND FILES ACTIVE? 
;BR IF NOT 
<RO);SAY COMMAND FILE ACTIVE 

;ADD BASE ADDR OF USER'S RMON AREA 
i RETURN VALUE IN USER 'S RO 



i Get TSX-Plus system value 



TSXGVL: 


NEG 


R2 ; 




CMP 


R2, #MXTSXV i 




BLOS 


1* i 




CLR 


RO i 




JMP 


SETERR 


1$: 


CLR 


RO i 




MOV 


TSXGVC<R2),R2 i 




CALL 


@R2 > 




MOV 


RO, URO i 




JMP 


EMTXIT i 



GET POSITIVE OFFSET VALUE 
IS IT IN LEGAL RANGE? 
BR IF OK 
RETURN ERROR CODE 

INITIALIZE VALUE TO ZERO 

GET ADDRESS OF ROUTINE TO SET VALUE 

CALL ROUTINE TO GET VALUE 

RETURN VALUE TO USER IN RO 

FINISHED 



TSX-Plus value offset vector 



TSXGVC = 


. -2 


. WORD 


TGJOBN 


. WORD 


TGLDIN 


. WORD 


TGPRIV 


. WORD 


TGIOMP 


. WORD 


TGPROJ 


. WORD 


TGPROG 


. WORD 


TGLICN 


. WORD 


TGCPRI 



-2. — Get job # 

-4. — Get Lead-in character 

-6. — Determine if this is a privileged job 

-8. — Determine if I/O page mapping in effect 

•10. — Job's project number 

-12. — Job 's programmer number 

-14. — TSX-Plus site license number 

-16. — Current execution priority 



TSEM2 


TSX-Plus EMT Ov 


er lay 


. GVAL 








58 


005552 


005670 ' 




59 


005554 


005712' 




60 


005556 


005720' 




61 


005560 


005746' 




62 


005562 


005676' 




63 


005564 


005704' 




64 


005566 


005736' 




65 


005570 


005754' 




66 


005572 


005762' 




67 




000042 




68 








69 








70 








71 


005574 


010100 




72 


005576 


006200 




73 


005600 


000207 




74 








75 








76 








77 


005602 


113700 


OOOOOOG 


78 


005606 


000207 




79 








80 








81 








82 


005610 


032737 


0000000 


83 


005616 


001401 




84 


005620 


005200 




85 


005622 


000207 




86 








87 








88 








89 


005624 


032761 


0000000 


90 


005632 


001401 




91 


005634 


005200 




92 


005636 


000207 




93 








94 








95 








96 


005640 


016100 


OOOOOOG 


97 


005644 


000207 




98 








99 








100 








101 


005646 


016100 


OOOOOOG 


102 


005652 


000207 




103 








104 








105 








106 


005654 


013700 


OOOOOOG 


107 


005660 


000207 




108 








109 








110 








111 


005662 


116100 


OOOOOOG 


112 


005666 


000207 




113 








114 









MACRO V05. 05 Wednesday 18-Jan-S9 10:37 Page 27-1 





. WORD 


TGMPRI 




. WORD 


TGUCLB 




. WORD 


TGPRIL 




. WORD 


TGSYNM 




. WORD 


TGPRLO 




. WORD 


TGPRHI 




. WORD 


TGPRNT 




. WORD 


TGVERS 




. WORD 


TGRSUB 


MXTSXV 


™ 


<. -TSXGVO-2 


j Get 


job numb 


er 



— Maximum authorized priority 

— Number of data blocks/job in UCL file 

— Primary line # 

— Name of physical SY device 

— Get value of PRILOW 

— Get value of PRIHI 

— Get parent job number 

— Get system version number 

— Get relative subprocess number 



TGJOBN: MOV R1,R0 
ASR RO 
RETURN 

Get Lead-in character 

TGLDIN: MOVB VTSLCH, RO 
RETURN 



; GET JOB INDEX NUMBER 
i CONVERT TO JOB NUMBER 



i GET LEAD-IN CHARACTER VALUE 



Determine if this is a privileged job 



OOOOOOG TGPR IV: BIT #P0*SYS, PRIVCO 

BEQ 1* 

INC RO 
1*: RETURN 



ARE WE PRIVILEGED? 

BR IF NOT 

SET PRIVILEGED FLAG 



Determine if I/O page mapping is in effect 



OOOOOOG TGIOMP: BIT #*IOMAP, LSW6(R1 > 

BEQ 1* 

INC RO 
1*: RETURN 



IS I/O PAGE MAPPING IN EFFECT? 

BR IF NOT 

SAY MAPPING IS IN EFFECT 



Get Project number 

TGPROJ: MOV LPR0J<R1),R0 
RETURN 

Get programmer number 

TGPROG: MOV LPROGtRl > , RO 
RETURN 



i GET PROJECT # 



> GET PROGRAMMER # 



Get TSX-Plus site license number 

TGLICN: MOV TSXSIT, RO ; GET LICENSE NUMBER 
RETURN 

Get current job execution priority 

TGCPRI: MOVB LPRKR1),R0 i Get current job priority 
RETURN 

; Get maximum authorized job priority 



TSEM2 


TSX-Plus EMT Ov 


er lay 


. GVAL 








115 








116 


005670 


113700 


OOOOOOG 


117 


005674 


000207 




118 








119 








120 








121 


005676 


113700 


OOOOOOG 


122 


005702 


000207 




123 








124 








125 








126 


005704 


113700 


OOOOOOG 


127 


005710 


000207 




128 








129 








130 








131 


005712 


013700 


OOOOOOG 


132 


005716 


000207 




XJm 








134 








135 








136 


005720 


016100 


OOOOOOG 


137 


005724 


020001 




138 


005726 


001001 




139 


005730 


005000 




140 


005732 


006200 




141 


005734 


000207 




142 








143 








144 








145 


005736 


016100 


OOOOOOG 


146 


005742 


006200 




147 


005744 


000207 




148 








149 








150 








151 


005746 


013700 


OOOOOOG 


152 


005752 


000207 




153 








154 








155 








156 


005754 


012700 


OOOOOOG 


157 


005760 


000207 




158 








159 








160 








161 


005762 


010546 




162 


005764 


005000 




163 


005766 


020127 


OOOOOOG 


164 


005772 


003414 




165 


005774 


016105 


OOOOOOG 


166 


006000 


016505 


OOOOOOG 


167 


006004 


005200 




168 


006006 


120125 




169 


006010 


001405 




170 


006012 


020027 


OOOOOOG 


171 


006016 


002772 





MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 27-2 



; Get maximum authorized execution priority 



TGMPRI: MOVB MXJPRI, RO 
RETURN 

Get value of PRILOW 

TGPRLO: MOVB VPRILO, RO 
RETURN 

Get value of PRIHI 

TGPRHI: MOVB VPRIHI,RO 
RETURN 

Get number of blocks per job in TSXUCL data base file 

TGUCLB: MOV UCLBLK, RO ; Get number of blocks per job 
RETURN 

Get number of controlling primary line <0 if we are a primary line) 

TGPRIL: 



1*: 



MOV 
CMP 
BNE 
CLR 
ASR 
RETURN 



LNPRIM(R1)>R0 

RO, Rl 

1* 

RO 

RO 



; Get number of our primary line 

; Are we the primary line? 

; Br if not 

; Return if we are a primary line 

; Convert from 2#job # to job # 



Get number of parent job 

TGPRNT: MOV LPARNTCRl ) , RO 
ASR RO 
RETURN 



> Get parent job index number 
i Convert to job number 



Get physical name of SY device 
TGSYNM 



MOV SYNAME, RO 
RETURN 



Get system version number 
TGVERS 



» Get SY physical device name 



MOV #TSXVRS, RO 
RETURN 



Get 
TGRSUB: 



; Get system version number 
relative subprocess number 



1*: 



MOV R5, -<SP> 

CLR RO 

CMP R1,#LSTDL 

BLE 8* 

MOV LNPRIM(Rl), R5 

MOV LSECPT<R5),R5 

INC RO 

CMPB Rl, <R5>+ 

BEQ 8* 

CMP RO, #MAXSEC 

BLT 1* 



Save R5 

Primary and detached are relative O 

Is this a virtual line? 

Branch if not 

Get owner line number 

Get pointer to owner's subprocess list 

Count subprocess number 

Is this our line? 

Done if line matches 

Any more possible? 

Keep checking if so 



< 
« 

i 

< 

^ 



4 

( 

4 
< 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 27-3 
. GVAL 

172 006020 012700 177777 MOV #-l,RO iWhoa! This should never happen! 

173 006024 012605 8*: MOV <SP>+, R5 i Restore R5 

174 006026 000207 RETURN 



« 

c 

t 
I 

I 
( 

( 
I 

< 

< 

« 

i 

4 

< 

i 

i 

« 
i 



TSEM2 
. GVAL 



TSX-Plus EMT Overlay 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 28 



1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 



. PVAL 



Store value into monitor table 



006030 
006034 
006036 
006042 
006044 
006050 
006056 
006062 



006066 
006072 
006074 
006100 
006102 
006106 
006110 
006114 
006120 
006124 

006130 
006136 
006140 



006142 
006146 
006150 
006154 
006156 
006162 
006164 
006170 
006174 
006200 
006202 

006206 
006214 
006216 



006220 
006222 



006226 
006230 
006232 



032702 
001071 
020227 
101066 
063702 
016237 
010362 
000137 



032702 
001052 
020227 
103413 
020227 
101010 
162702 
063702 
011237 
000137 

032737 
001430 
000767 



032702 
001024 
020227 
103414 
020227 
101011 
162702 
063702 
011237 
010312 
000137 

032737 
001401 
000766 



000001 

OOOOOOG 

OOOOOOG 
000002 
000002 
OOOOOOG 



000001 

OOOOOOG 

OOOOOOG 

177776G 
OOOOOOG 
OOOOOOG 
OOOOOOG 



PVAL: 



OOOOOOG 



BIT 


#1, R2 


BNE 


GVBAD 


CMP 


R2, ttMAXGVl 


BHI 


GVBAD 


ADD 


CXTRMN, R2 


MOV 


2<R2>, URO 


MOV 


R3, 2(R2) 


JMP 


EMTXIT 



IS ADDRESS ODD? 

BR IF YES — ERROR 

IS VALUE IN PROPER RANGE? 

BR IF NOT 

ADD BASE ADDRESS OF JOB'S RMON AREA 

RETURN ORIGINAL VALUE IN RO 

STORE NEW VALUE 

FINISHED 



. PEEK 



Get value from specified memory location 



PEEK: 



PKGET: 



i Peek 
OOOOOOG OOOOOOG PKLOW: 



BIT 

BNE 

CMP 

BLO 

CMP 

BHI 

SUB 

ADD 

MOV 

JMP 

into 

BIT 

BEQ 

BR 



#1, R2 

GVBAD 

R2, #RMNBAS 

PKLOW 



i IS ADDRESS ODD? 

; BR IF YES — ERROR 

i IS ADDRESS WITHIN RMON TABLE? 

;BR IF TOO LOW 



R2, #RMNBAS+MAXGVL i IS IT TOO BIG? 



; BR IF YES 

i MAKE ADDRESS INTO OFFSET 

;ADD BASE ADDRESS OF JOB'S RMON AREA 

i RETURN VALUE 



. POKE 



PKLOW 

#<RMNBAS-2>, R2 
CXTRMN, R2 
<R2),UR0 
EMTXIT 
low memory area or I/O page 

#PO*MEM> PRIVCO ; Are we authorized to access phys memory? 

GVBAD ;BR IF NOT 

PKGET i GO GET THE VALUE 

Store value into specified memory location 



000001 

OOOOOOG 

OOOOOOC 

177776G 
OOOOOOG 
OOOOOOG 

OOOOOOG 

OOOOOOG 



POKE: 



POVAL: 



i Poke 
OOOOOOG POLOW: 



BIT 

BNE 

CMP 

BLO 

CMP 

BHI 

SUB 

ADD 

MOV 

MOV 

JMP 

into 

BIT 

BEQ 

BR 



#1,R2 

GVBAD 

R2, #RMNBAS 

POLOW 



; IS ADDRESS ODD? 

; ERROR IF YES 

i IS ADDRESS WITHIN RMON TABLE? 

; BR IF TOO LOW 



R2> #RMNBAS+MAXGVL ; IS IT TOO BIG? 
POLOW > BR IF YES 

#<RMNBAS-2>, R2 ; CONVERT TO OFFSET WITHIN TABLE 
CXTRMN, R2 ; ADD BASE OF JOB'S RMON AREA 
(R2),UR0 iGET ORIGINAL VALUE 
R3, (R2) ;SET NEW VALUE 

EMTXIT ; FINISHED 

low memory or I/O page 

#PO*MEM> PRIVCO i Are we authorized to access phys memory? 
GVBAD > BR IF NOT 

POVAL i GO STORE VALUE 



Invalid offset specified 



005000 

000137 OOOOOOG 



005404' 
006066 ' 
006030 ' 



GVBAD: CLR 

JMP 



RO 
SETERR 



i RETURN ERROR # 



Sub-function jump vector 

GVJMP: . WORD DOGVAL 
. WORD PEEK 
. WORD PVAL 



- . GVAL 

1 - . PEEK 

2 - . PVAL 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 28-1 

. GVAL 

58 006234 006142' .WORD POKE »3 - .POKE 



I 

( 



TSEM2 
. EXIT 



TSX-Plus EMT Overlay 



006236 005061 OOOOOOG 



1 

2 

3 

4 

5 

6 

7 

8 

9 006242 
10 006250 
11 

12 006252 

13 006256 

14 006260 

15 006262 

16 006266 

17 006270 
IS 006274 

19 006300 

20 006302 
006304 
006306 
006310 
006312 
006314 



21 
22 
23 



25 
26 
27 
28 
29 006316 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 29 

. SBTTL .EXIT 
Program exit 
EXIT: CLR LEMTPC<R1> ; CLEAR ADDRESS OF LAST USER-MODE EMT 
See if program wants to pass some commands to TSKMON. 



032761 OOOOOOC OOOOOOG 



000510 



000266 

000266 
0000 10G 



012704 
106524 
012602 
020227 
101402 
012702 
012703 
010223 
001405 
005202 
006202 
106524 
012623 
077203 



004737 OOOOOOG 



BIT #PASLIN!SCHAIN, LJ5W<R1>; DOES PROGRAM WANT TO PASS COMMANDS? 

BEQ 2* ; BR IF NOT 

Move commands from job chain data area to context area chain data cell. 

; ADDRESS OF CELL WITH BYTE COUNT 
i GET COUNT OF # BYTES TO MOVE 



3$: 



1*: 



MOV 


#510, R4 


MFPD 


(R4) + 


MOV 


<SP)+, R2 


CMP 


R2, #<1000-512> 


BLOS 


3* 


MOV 


#< 1 000-5 12>, R2 


MOV 


#CINDAT+10, R3 


MOV 


R2, <R3) + 


BEQ 


2* 


INC 


R2 


ASR 


R2 


MFPD 


<R4) + 


MOV 


<SP>+, (R3) + 


SOB 


R2, 1* 



BR IF OK 

POINT TO CHAIN DATA CELL IN CONTEXT AREA 

STORE BYTE COUNT 

BR IF NULL COMMAND BEING PASSED TO US 

ROUND UP 

GET # WORDS TO MOVE 

GET NEXT WORD OF DATA TO MOVE 

MOVE TO CONTEXT AREA 

MOVE ALL OF COMMANDS 



Stop program execution and enter TSKMON 
2*: CALL STOP i TERMINATE PROGRAM EXECUTION 



TSEM2 TSX-Plus EMT Overlay 
TTEMT — Terminal control EMT 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 30 



1 

2 

3 

4 

5 

6 

7 

8 

9 

10 

11 

12 

13 

14 

15 

16 

17 

18 

19 

20 

21 

22 

23 

24 

25 

26 

27 

28 

29 

30 

31 

32 



SBTTL TTEMT 



Terminal control EMT 



006322 
006326 
006332 
006334 
006340 
006342 
006344 
006350 
006356 
006362 
006364 



006370 
006374 



013702 
162702 
100416 
020227 
103013 
006302 
013700 
016237 
004737 
000000 
000137 



012700 
000137 



The terminal control EMT is used to perform all of the terminal 
control functions that can also be performed by use of the 
lead-in type terminal functions. 
The form of the EMT argument block is: 

. BYTE 0, 152 

.WORD function value 

.WORD control_value 

Where "f unc tion_value" corresponds to the value of the ascii character 
that would be used with the lead-in sequence* and "control_yalue" 
corresponds to the letter that would be sent as an argument to some 

of the control functions. 



000002G 
000101 

OOOOOOG 



000004G 

006400' 006362' 
OOOOOOG 

OOOOOOG 



000001 
OOOOOOG 



TTEMT: 



1*: 



MOV 


EMTBLK+2, R2 


SUB 


#'A, R2 


BMI 


9* 


CMP 


R2, #MAXCC 


BHIS 


9* 


ASL 


R2 


MOV 


EMTBLK+4, RO 


MOV 


TTFUN<R2>, 1* 


CALL 


OVRHC 


. WORD 





JMP 


EMTXIT 



Get f unction_value 

Convert letter into index value 

Br if not legal value 

Is the letter ok? 

Br if too big 

Convert to word table index 

Get control_value 

Set address of processing routine 

Call overlay handler 

Store address of routine to call here 

Finished 



Error — Invalid function value 



9*: 



MOV 
JMP 



#1,R0 
SETERR 



i Return error code 1 



TSEM2 


TSX-Plus EMT 0v 


TTEMT - 
1 


-- Terminal cont 


2 
3 
4 


006400 


0000000 


5 


006402 


OOOOOOG 


6 


006404 


OOOOOOG 


7 


006406 


OOOOOOG 


8 


006410 


OOOOOOG 


9 


006412 


OOOOOOG 


10 


006414 


OOOOOOG 


11 


006416 


OOOOOOG 


12 


006420 


OOOOOOG 


13 


006422 


OOOOOOG 


14 


006424 


OOOOOOG 


15 


006426 


OOOOOOG 


16 


006430 


OOOOOOG 


17 


006432 


OOOOOOG 


18 


006434 


OOOOOOG 


19 


006436 


OOOOOOG 


20 


006440 


OOOOOOG 


21 


006442 


OOOOOOG 


22 


006444 


OOOOOOG 


23 


006446 


OOOOOOG 


24 


006450 


OOOOOOG 


25 


006452 


OOOOOOG 


26 


006454 


OOOOOOG 


27 


006456 


OOOOOOG 


28 


006460 


OOOOOOG 


29 


006462 


OOOOOOG 



MACRO V05. 05 Wednesday 18-Jan-S9 10:37 Page 31 



Vector of addresses of processing routines 



TTFUN: 



. WORD 


SETRBF 


. WORD 


CMDB 


. WORD 


CMDC 


. WORD 


GTSPAC 


. WORD 


CMDE 


. WORD 


CMDF 


. WORD 


CMDG 


. WORD 


CMDH 


. WORD 


CMDI 


. WORD 


CMDJ 


. WORD 


CMDK 


. WORD 


CMDL 


. WORD 


CMDM 


. WORD 


CMDN 


. WORD 


CMDO 


. WORD 


RSSPAC 


. WORD 


SFWAC 


. WORD 


CMDR 


. WORD 


CMDS 


. WORD 


CMDT 


. WORD 


CMDU 


. WORD 


SFWL 


. WORD 


CMDW 


. WORD 


CMDX 


. WORD 


CMDY 


. WORD 


CMDZ 



A 
B 
C 
D 
E 
F 
G 
H 
I 
J 
K 
L 
M 
N 

P 

R 
S 
T 
U 
V 
W 
X 
Y 
Z 



TSEM2 
SNDMSG 



1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
IS 
1? 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 



TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 32 
— Send a message to a line 

. SBTTL SNDMSG — Send a message to a line 

Send an asciz message to a line. 

EMT argument block format: 

.BYTE Sub-function, 127 

. WORD Line-number 

. WORD Buffer-address 



Where Sub-function is: 

No-gag-override 
Hang 
Error 



006464 032737 OOOOOOG OOOOOOG SNDMSG: BIT 

006472 001003 BNE 

006474 005000 CLR 

006476 000137 OOOOOOG JMP 

006502 032737 OOOOOOG OOOOOOG 4*: BIT 



006510 001003 



042737 000001 OOOOOOG 



006520 013703 000002G 

006524 006303 

006526 020327 000002 

006532 103473 

006534 020327 OOOOOOG 

006540 101070 

006542 032763 OOOOOOG OOOOOOG 

006550 001464 

006552 032763 OOOOOOG OOOOOOG 

006560 001060 

006562 032763 OOOOOOG OOOOOOG 

006570 001414 

006572 032763 OOOOOOG OOOOOOG 

006600 001010 

006602 032737 000001 OOOOOOG 

006610 001004 

006612 012700 000001 

006616 000137 OOOOOOG 



006622 004737 006730 ' 

006626 103004 

006630 012700 000002 

006634 000137 OOOOOOG 



006640 013703 000004G 

006644 010300 

006646 004737 OOOOOOG 

006652 010402 



BNE 
BIC 





#PO*SND, PRIVCO 

4* 

RO 

SETERR 

#PO*OPR> PRIVCO 

5* 

#1, EMTBLK 



Gag-override 
1 
3 

i Are we authorized to send messages? 

; Br if yes 

; Return error code 

; Does user have OPER privilege? 

; Br if yes 

; Cannot override gag unless oper privilege 



See if a valid job number was specified. 



5*: 



MOV EMTBLK+2, R3 

ASL R3 

CMP R3, #2 

BLO 9* 

CMP R3, #LSTSL 

BHI 9* 

BIT #*DILUP,LSW<R3) 

BEG 9* 

BIT #*DETCH, LSW < R3 ) 

BNE 9* 

B I T #*TTGAG, LSW7 < R3 ) 

BEQ 3* 

BIT #*INKMN,LSW4<R3> 

BNE 3* 

BIT #1, EMTBLK 

BNE 3* 

MOV #1,R0 

JMP SETERR 

Get a free message buffer. 



GET NUMBER OF LINE TO RECEIVE MESSAGE 

CONVERT TO JOB INDEX NUMBER 

CAN'T BE LESS THAN 2 

BR IF TOO SMALL 

MAKE SURE NOT TOO LARGE 

BR IF TOO LARGE 

IS JOB LOGGED ON? 

BR IF NOT 

IS JOB A DETACH LINE? 

BR - DETACH LINES CAN'T RECEIVE 

IS LINE GAGGED? 

BR IF NOT 

IS KMON RUNNING NOW? 

BR IF YES 

DOES HE WANT TO OVERRIDE GAG? 

BR IF YES 

RETURN ERROR CODE 1 IF LINE IS GAGGED 



3*: 



CALL 


GTMSBF 


BCC 


6* 


MOV 


#2, RO 


JMP 


SETERR 



GET A FREE MESSAGE BUFFER 

CONTINUE IF NO ERROR 

RETURN ERROR CODE 2 IF NO MESSAGE BUFFERS 



Move message from user's buffer to system message buffer. 

6$: MOV EMTBLK+4, R3 > GET ADDRESS OF USER'S MESSAGE BUFFER 

; VALIDATE ADDRESS 

;GET ADDRESS OF SYSTEM MESSAGE BUFFER BLOCK 



MOV 


EMTBLK+4, R3 


MOV 


R3, RO 


CALL 


VALADB 


MOV 


R4, R2 



< 

< 

i 
i 
< 
t 
< 
I 
( 
t 
i 
< 
t 
I 
i 
i 
t 

« 
i 



TSEM2 TSX-Plus EMT Overlay MACRO 
SNDMSG — Send a message to a line 



V05. 05 Wednesday lS-Jan-89 10: 37 Page 32-1 



58 006654 

59 006660 

60 006662 

61 006666 

62 006672 

63 006674 

64 006676 

65 006700 

66 006702 
67 

68 
69 

70 006704 

71 006710 

72 006712 
73 

74 

75 

76 006716 

77 

78 

79 

80 006722 

81 006724 



062702 OOOOOOG 

010405 

062705 OOOOOOG 

004737 OOOOOOG 

110022 

001403 

020205 

103772 

105042 



013701 000002G 

006301 

004737 007052 ' 



000137 OOOOOOG 



005000 

000137 OOOOOOG 



ADD #SB*TXT, R2 

MOV R4, R5 

ADD #SB*END, R5 

1*: CALL GETUCH 

MOVB RO, (R2) + 

BEQ 2* 

CMP R2, R5 

BLO 1* 

CLRB -(R2) 



; POINT TO MESSAGE STORAGE AREA 

POINT TO END OF MESSAGE AREA 

GET CHAR FROM USER'S BUFFER 

MOVE TO SYSTEM MESSAGE BUFFER 

BR IF REACHED END 

REACHED END OF BUFFER SPACE? 

BR IF NOT 

Store null at end of message 



Queue the message for the receiving job. 



2*: 



MOV EMTBLK+2, Rl 
ASL Rl 
CALL QMSG 

Finished 

JMP EMTXIT 

Invalid line # 



GET # OF RECEIVING JOB 
CONVERT TO JOB INDEX # 
QUEUE MESSAGE FOR JOB 



9$ : 



CLR 
JMP 



RO 
SETERR 



i RETURN ERROR CODE 



i 

< 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday lS-Jan-89 10:37 Page 33 
GTMSBF — Get free system message buffer 



1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 



SBTTL GTMSBF 



Get free system message buffer 



GTMSBF is called to get a free system message buffer block. 

If none are available, the job is suspended until one becomes free. 



Outputs: 
R4 = Address of messaqe block acquired. 



006730 

006736 005737 000000G 

006742 003004 

006744 032737 000002 OOOOOOG 

006752 001035 

006754 013704 OOOOOOG 

006760 001013 

006762 032737 000002 OOOOOOG 

006770 001026 



GTMSBF: 


DISABL 






TST 


NMUMB 




BGT 


3* 




BIT 


#2, EMTBLK 




BNE 


7* 


3*: 


MOV 


SNMSHD, R4 




BNE 


1* 




BIT 


#2, EMTBLK 




BNE 


7* 



#* DISABLE ## 

ARE THERE ANY AVAILABLE MESSAGE BLOCKS? 

BR IF SO 

DOES USER WANT TO WAIT? 

BR IF NOT 

GET ADDRESS OF 1ST FREE BLOCK 

BR IF OK 

DOES USER WANT TO WAIT? 

BR IF NOT 



No message buffers available. 

Suspend job until one becomes available. 



006772 012700 OOOOOOG 

006776 004737 OOOOOOG 

007002 004737 OOOOOOG 

007006 000750 



007010 005337 OOOOOOG 

007014 016437 OOOOOOG OOOOOOG 

007022 

007030 010400 

007032 062700 OOOOOOG 

007036 010064 OOOOOOG 

007042 000241 

007044 000401 



?*: 



MOV 


#S*WSMB, RO 


CALL 


QNSPND 


CALL 


CHKABT 


BR 


GTMSBF 



WAIT FOR MESSAGE BUFFER STATE. 
WAIT FOR MESSAGE BUFFER ** ENABLE #* 
WERE WE ABORTED WHILE ASLEEP? 
TRY AGAIN 



1$: 



007046 000261 



007050 000207 



Got a buffer. Unlink from free chain. 

DEC NMUMB i ONE LESS FREE BUFFER 

MOV SB*LNK<R4>, SNMSHD; REMOVE FROM FREE LIST 

ENABL i ** ENABLE ## 

MOV R4, RO i INITIALIZE SB*PNT 

ADD #SB*TXT, RO 

MOV RO, SB*PNT<R4> 

CLC > SAY NO ERRORS 

BR 9* 



No free message buffers, flag error return 
7$: SEC 

Finished 
9$: RETURN 



TSEM2 TSX-Plus EMT Overlay 
QMSG — Queue a message for a 



1 

2 








3 








4 








5 








6 








7 








S 








9 


007052 


010146 




10 








11 








12 








13 


007054 






14 


007062 


016101 


OOOOOOG 


15 


007066 


016100 


OOOOOOG 


16 


007072 


001411 




17 


007074 


005760 


OOOOOOG 


IS 


007100 


001403 




19 


007102 


016000 


OOOOOOG 


20 


007106 


000772 




21 


007110 


010460 


OOOOOOG 


22 


007114 


000402 




23 


007116 


010461 


OOOOOOG 


24 


007122 


005064 


OOOOOOG 


25 


007126 






26 








27 








28 








29 


007134 


116101 


OOOOOOG 


30 


007140 


004777 


OOOOOOG 


31 








32 








33 








34 


007144 


012601 




35 


007146 


000207 





MACRO V05. 05 Wednesday 18-Jan-89 10: 37 Page 34 
job 

. SBTTL QMSG — Queue a message for a job 



QMSG is called to queue a system message for a job. 

Inputs: 
Rl = Job number that is to receive message. 
R4 ~ Address of system message buffer. 

QMSG: MOV R1,-(SP> 

Add message buffer to queue for line 



## DISABLE ## 

OBTAIN THE CURRENT PRIMARY LINE NUMBER 

GET ADDRESS OF HEAD OF MESSAGE LIST FOR JOB 

BR IF NO MESSAGES QUEUED FOR JOB 

IS THIS LAST ENTRY IN LIST? 

BR IF YES 

CHAIN TO NEXT QUEUED MESSAGE BLOCK 

ADD OUR MESSAGE TO TAIL OF LIST 

ADD OUR MESSAGE BLOCK TO LIST FOR JOB 
SAY WE ARE AT END OF LIST 
*# ENABLE ## 



1*: 



2*: 

3*: 
4*: 



DISABL 




MOV 


LNPRIM<R1),R1 


MOV 


LMSGBF<R1>,R0 


BEQ 


3* 


TST 


SB*LNK(RO) 


BEQ 


2* 


MOV 


SB*LNK<RO>, RO 


BR 


1* 


MOV 


R4, SB*LNK(RO) 


BR 


4* 


MOV 


R4, LMSGBF(Rl) 


CLR 


SB*LNKCR4> 


ENABL 





Initiate transmission to the line. 



MOVB 


LNMAP(Rl), Rl 


wnLL 


OTRNSTR 


Finished 




MOV 


(SP)+, Rl 


RETURN 





;GET virtual line # 
j initiate transmission 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 35 
ASTXIT — Exit from completion routine 



1 

2 

3 

4 

5 007150 

6 

7 

a 

9 007150 013702 OOOOOOG 

10 007154 020227 OOOOOOG 

11 007160 001002 

12 007162 000137 OOOOOOG 

13 007166 012237 OOOOOOG 

14 007172 010237 OOOOOOG 

15 007176 000137 OOOOOOG 



. SBTTL ASTXIT — Exit from completion routine 
The ASTXIT EMT is used to exit from a user completion routine. 
ASTXIT: 

Set up information that will sidetrack control in EMTXIT. 



1*: 



MOV EMTCAD, R2 

CMP R2, #EMTCAS 

BNE 1* 

JMP BADEMT 

MOV <R2>+, EMTRAD 

MOV R2, EMTCAD 

JMP EMTXIT 



; Get pointer to top entry on return stack 

i Were we expecting a completion routine exit? 

; Br if yes 

; Illegal EMT if nothing on cpl rtn return stk 

; Set return address for compl routine 

; Save new stack pointer 

; EMTXIT will do the actual exit for us 



TSEM2 
. SPCPS 



TSX-Plus EMT Overlay 
-- Alter exit address 



MACRO V05. 05 Wednesday 
from a completion routine 



18-Jan-89 10:37 Page 36 



1 
2 
3 
4 
5 
6 

7 007202 

8 007206 

9 007210 

10 007212 

11 007216 

12 007222 

13 007224 

14 007230 

15 007234 

16 007240 

17 007244 

18 007250 



. SBTTL . SPCPS 



Alter exit address from a completion routine 



The . SPCPS EMT is used to set a address that is used to control the 
mainline code execution on exit from a completion routine. 
The real work to accomplish this is done in SYSXIT. 



105737 
001003 
005000 
000137 
005737 
001404 
012700 
000137 
013700 
004737 
010037 
000137 



OOOOOOG 



OOOOOOG 
OOOOOOG 

000001 

OOOOOOG 

000002G 

OOOOOOG 

OOOOOOG 

OOOOOOG 



ESPCPS: T5TB 
BNE 
CLR 
JMP 

1*: TST 
BEQ 
MOV 
JMP 

2*: MOV 
CALL 
MOV 
JMP 



CURCP 

1* 

RO 

SETERR 

SPCPS 

2$ 

#1, RO 

SETERR 

EMTBLK+2, RO 

VALADW 

R0» SPCPS 

EMTXIT 



ARE WE IN A COMPLETION ROUTINE NOW? 

BR IF YES 

RETURN ERROR CODE IF NOT 

IS ANOTHER . SPCPS PENDING NOW? 

BR IF NOT 

RETURN ERROR CODE 1 IF YES 

GET ADDRESS OF USER'S INFORMATION BLOCK 

VALIDATE THE ADDRESS 

SAVE ADDRESS OF INFO BLOCK 

EXIT — SYSXIT WILL DO REAL PROCESSING 



i 

< 



TSEM2 
EMT376 - 

i 

2 

3 

4 

5 

6 

7 

8 

9 

10 

11 

12 

13 

14 

15 

16 

17 

18 

19 

20 

21 

22 



TSX-Plus EMT Overlay 
— EMT 376 Processing 



007254 
007260 
007262 
007266 
007272 
007274 
007276 
007302 
007304 



007310 
007314 
007322 



120427 
0010U 
013704 
106564 
012600 
000300 
120027 
001402 
000137 



010437 
012737 
004737 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 37 

. SBTTL EMT376 — EMT 376 Processing 
Process EMT 376 



Inputs: 
R4 = EMT function code. 



000376 

OOOOOOG 
000002 



000373 
OOOOOOG 



OOOOOOG 

177750 OOOOOOG 

OOOOOOG 



EMT376: 


CMPB 


R4, #376 




BNE 


1* 




MOV 


EMTADR, R4 




MFPD 


2<R4) 




MOV 


<SP)+, RO 




SWAB 


RO 




CMPB 


RO, #373 




BEG 


2* 


1*: 


JMP 


BADEMT 



Overlay I/O error 



?*: 



MOV 


R4, ABRTAD 


MOV 


#-30, ABRTCD 


CALL 


STOP 



Is this an EMT 376? 

Br if not 

Get address of EMT instruction 

Get value that follows instruction 

Get code word 

Get code byte to low-order 

Overlay I/O error? 

Br if yes 

Invalid EMT if not 



Set address of abort 
Set abort code 
Abort the job 



c 

< 
i 
< 

< 



TSEM2 TSX-Plus EMT Overlay 
JBINFO — Get information about 



1 

2 

3 

4 

5 

6 

7 

8 

9 
10 
11 
12 
13 
14 

15 007326 

16 007332 

17 007336 

18 007340 

19 007344 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 38 
a specific job 

. SBTTL JBINFO • — Set information about a specific job 

The JBINFO EMT is used to obtain information about a specific job. 

The form of the EMT argument- block is: 

+ + + 

! 144 ! ! 

.+. + + 

iSub Fun. ! Job # ! 

+ + + 

i Result buf addr ! 

+ + 

Get Subfunction number and check its range 



113705 000003G 

020527 000012 

101404 

012700 000001 

000137 OOOOOOG 



JBINFO: MOVB 
CMP 
BLOS 
MOV 
JMP 



EMTBLK+3, R5 

R5, #MXJIFN 

1$ 

#1>R0 

SETERR 



GET SUB-FUNCTION NUMBER 

IS IT TOO BIG? 

BR IF OK 

ERROR CODE 1 IF TOO BIG 



20 
21 
22 
23 

24 007350 

25 007354 

26 007356 

27 007360 

28 007364 

29 007366 

30 007372 
31 

32 
33 

34 007376 

35 007404 

36 007406 

37 007410 
38 

39 
40 

41 007414 

42 007420 

43 007422 
44 

45 
46 
47 
48 
49 
50 
51 

52 007426 

53 007430 
54 

55 
56 
57 007434 



Subfunction number is valid. 
Check job number. 



113701 
001404 
006301 
020127 
101404 
012700 
000137 



032761 
001003 
005000 
000137 



013704 
010400 
004737 



000002G 



OOOOOOG 

000002 
OOOOOOG 



1*: 



2*: 



MOVB 


EMTBLK+2, Rl 


BEQ 


2* 


ASL 


Rl 


CMP 


Rl, #LSTSL 


BLOS 


3* 


MOV 


#2, RO 


JMP 


SETERR 



GET SPECIFIED JOB NUMBER 

ZERO IS INVALID 

CONVERT TO LINE INDEX NUMBER 

IS IT A VALID NUMBER? 

BR IF YES 

ERROR 2 IF INVALID LINE NUMBER 



See if line is currently logged on 



OOOOOOG OOOOOOG 3*: 



OOOOOOG 

000004G 
OOOOOOG 



BIT #*KINIT, LSW<R1> 

BNE 4* 

CLR RO 

JMP SETERR 



IS THE LINE LOGGED ON NOW? 

BR IF YES 

ERROR # IF NOT 



Check the address specified for the user's result buffer 
4*: MOV EMTBLK+4, R4 i GET USER 'S VIRTUAL ADDRESS 

; MAKE SURE ADDRESS IS REASONABLE 



MOV 
MOV 
CALL 



EMTBLK+4, R4 
R4, RO 
VALADW 



Everything looks good. 

Branch off to processing routine based on sub-function number. 

At this point the following registers are set up: 

Rl = Line index number for job about which information is desired. 

R4 = Address of user's buffer where result is to be placed. 

R5 = Sub function index number. 



006305 
000175 



005000 



010014' 



ASL R5 

JMP @JIJMPX<R5> 

#0 — Get job status flags 

JISTAT: CLR RO 



i CONVERT SUB-FUNCTION # TO WORD INDEX 
; ENTER PROCESSING ROUTINE 



i DEVELOP FLAGS IN RO 



TSEM2 TSX-Plus EMT Overlay 
JBINFO — Get information about 



MACRO V05. 05 Wednesday 18-Jan-89 10: 37 
a specific job 



Page 38-1 



58 

59 

60 

61 

62 

63 

64 

65 

66 

67 

68 

69 

70 

71 

72 

73 

74 

75 

76 

77 

78 

79 

80 

81 

82 

83 

84 

85 

86 

87 

88 

89 

90 

91 

92 

93 

94 

95 

96 

97 

98 

99 

100 

101 

102 

103 

104 

105 

106 

107 

108 

109 

110 

111 

112 

113 

114 



007436 
007442 
007444 
007450 
007452 
007456 
007460 

007464 
007472 
007474 

007500 
007502 
007510 
007512 
007516 
007520 
007524 
007530 
007536 
007544 
007546 
007552 
007560 
007562 



007564 
007570 
007574 
007576 
007600 
007602 
007606 
007610 
007612 
007614 
007616 



007620 
007624 
007630 
007632 
007634 



007640 
007644 
007650 



020127 
101410 
020127 
101403 
052700 
000402 
052700 

032761 
001402 
052700 OOOOOOG 



010046 

103002 
004737 
010102 
012703 
012700 

032777 
001402 
052716 

012600 
000422 



012700 
116102 
120220 
001406 
005200 
020027 
103772 
005000 
000406 
111000 
000404 



016100 
066100 
010046 
106614 
000137 



013700 
166100 
000767 



OOOOOOG 

OOOOOOG 

OOOOOOG 

OOOOOOG 2*: 

•> See 
OOOOOOG OOOOOOG 1*: 



OOOOOOG 

OOOOOOG 
000002 

OOOOOOG OOOOOOG 

OOOOOOG 



> See if job is detached or vi 

CMP R1,#LSTPL 

BLOS 1* 

CMP R 1 , #LSTDL 

BLOS 2* 

BIS #JIVLN, RO 

BR 1* 

BIS #JIDLN, RO 

if job is locked in memo 

BIT #*MLOCK, LSW6<R1 

BEQ 4* 

BIS #JIMLOK, RO 

; See if job has operator priv 

4*: MOV RO, -<SP) 

OCALL GETCXT 

BCC 6* 

CALL STOP 

6*: MOV R1,R2 

MOV #PRIVCO, R3 

MOV #2, RO 

OCALL REDCXT 

BIT #PO*SYS, eCXTBUF 

BEQ 5* 

BIS #JIPRIV, <SP) 

5$: OCALL FRECXT 

MOV <SP>+, RO 

BR JIRET1 



010042' 
OOOOOOG 



010126 



#1 — Get job's run state 
J I RUN: 
1*: 



OOOOOOG 
OOOOOOG 



OOOOOOG 



OOOOOOG 
OOOOOOG 



?*: 

#2 
J I MEM: 
J I RET 1 

#3 
JICONT 

; #4 



MOV 

MOVB 

CMPB 

BEQ 

INC 

CMP 

BLO 

CLR 

BR 

MOVB 

BR 



#JIRNST, RO 

LSTATE<R1),R2 

R2, (R0) + 

2* 

RO 

RO, #J.TRNND 

1* 

RO 

J I RET 1 

(RO),RO 

JIRET1 



rtual 

PRIMARY LINE? 

BR IF YES 

DETACHED LINE? 

BR IF YES 

SET VIRTUAL-LINE FLAG 

; SET DETACHED-LINE FLAG 
ry 
);IS JOB LOCKED IN MEMORY? 

; BR IF NOT 

; SET MEMORY-LOCKED FLAG 
ilege 

; SAVE OUR STATUS CODES 

; GET EXCLUSIVE ACCESS TO CONTEXT BUFFER 

; BR IF GOT IT 

;JOB WAS ABORTED WHILE WAITING 

; GET INDEX # OF JOB WE ARE COPYING FROM 

j ADDR OF INFO TO GET 

;GET # BYTES TO COPY 

i GET INFO FROM CONTEXT BLOCK OF OTHER JOB 

; IS THIS A PRIVILEGED JOB? 

; BR IF NOT 

; SET PRIVILEGE FLAG 

> FREE THE CONTEXT BUFFER 

; GET STATUS FLAGS 

; GO RETURN VALUE 



Point to state table 

Get job's current execution state 

Search for state in table 

Br if found it 

Skip over value 

Checked all entries? 

Br if yes 

Don't recognize state* return O 

Return the value 

Get value to return 

Return the value 



— Get amount of memory in use by job 



MOV 
ADD 
: MOV 
MTPD 
JMP 

— Get 

MOV 
SUB 
BR 



LNBLKS<R1>, RO 

LN5BLK<R1),R0 

RO, -<SP> 

<R4) 

EMTXIT 



GET # 256-WORD BLOCKS USED BY JOB 
ADD # BLOCKS USED BY PL AS REGIONS 
STORE VALUE INTO USER'S BUFFER 



i FINISHED WITH EMT 
job connect time (minutes) 



MINTIM, RO 
LCONTM(Rl), RO 
JIRET1 



GET CURRENT SYSTEM UP-TIME 

GET # MINUTES JOB HAS BEEN CONNECTED 



Get base 256-mord block # assigned to job area 



TSEM2 


TSX-Plus EMT Ov 


er lay 


JBINFO - 


— Get information about 


115 








116 


007652 


016100 


OOOOOOG 


117 


007656 


000764 




118 








119 








120 








121 


007660 


016102 


OOOOOOG 


122 


007664 


016103 


0000000 


123 


007670 


000411 




124 








125 








126 








127 


007672 


016102 


OOOOOOG 


128 


007676 


016103 


OOOOOOG 


129 


007702 


000404 




130 








131 








132 








133 


007704 


016102 


OOOOOOG 


134 


007710 


016103 


OOOOOOG 


135 


007714 


010246 




136 


007716 


106624 




137 


007720 


010346 




138 


007722 


106624 




139 


007724 


000137 


OOOOOOG 


140 








141 








142 








143 


007730 


116100 


OOOOOOG 


144 


007734 


000735 




145 








146 








147 








148 


007736 


010105 




149 


007740 


012702 


000006 


150 


007744 


070502 




151 


007746 


062705 


OOOOOOG 


152 


007752 


012546 




153 


007754 


106624 




154 


007756 


077203 




155 


007760 


000137 


OOOOOOG 


156 








157 








158 








159 


007764 


016102 


OOOOOOG 


160 


007770 


006202 




161 


007772 


016103 


OOOOOOG 


162 


007776 


006203 




163 


010000 


010246 




164 


010002 


106624 




165 


010004 


010346 




166 


010006 


106624 




167 


010010 


000137 


OOOOOOG 


168 








169 








170 








171 


010014 


007434 ' 





MACRO V05. 05 Wednesday 18-Jan-89 10: 37 
a specific job 



JIBASE: MOV 
BR 



LBASE(Rl), RO 
JIRET1 



Page 38-2 



i GET BASE BLOCK # 



#5 — Get name of program being run by job 



JIPROG: MOV 
MOV 
BR 



LPRGKRi), R2 
LPRG2<R1), R3 
JIRET2 



i GET FIRST 3 CHARS OF NAME 
i GET SECOND 3 CHARS OF NAME 



#6 — Get project/programmer number 



JIPPN: MOV LPR0J<R1>,R2 
MOV LPR0G(R1),R3 
BR JIRET2 



i GET PROJECT NUMBER 

; GET PROGRAMMER NUMBER 



#7 — Get CPU time used by job 
JICPU: 



MOV 
MOV 
JIRET2: MOV 
MTPD 
MOV 
MTPD 
JMP 



LCPUHI<R1),R2 
LCPUL0<R1),R3 
R2, -<SP> 
<R4> + 
R3, -(SP) 
(R4) + 
EMTXIT 



#8 



Job execution priority 



JIPRIO: MOVB 
BR 



LPRKRD* RO 
JIRET1 



GET HIGH-ORDER CPU TIME 
GET LOW-ORDER CPU TIME 
RETURN FIRST WORD OF RESULT 

RETURN SECOND WORD OF RESULT 

FINISHED WITH EMT 



; Get current execution priority for job 
; Return 



#9 



Job name 



J I NAME: MOV 
MOV 
MUL 
ADD 

1$: MOV 
MTPD 
SOB 
JMP 



Rl, R5 
#6, R2 
R2, R5 

#LUNAMEi R5 
<R5)+, -<SP) 
<R4) + 
R2> 1* 
EMTXIT 



Copy job index number 
6 words per name 
Name should be 12 bytes long 
Convert to name table index 
Fetch next two bytes of name 
Move to user's buffer 
Loop through whole name 
Finished with EMT 



#10 — Parent and primary job numbers 



JIPAPR: MOV 
ASR 
MOV 
ASR 
MOV 
MTPD 
MOV 
MTPD 
JMP 



LNPRIM<R1),R2 

R2 

LPARNT<R1),R3 

R3 

R2, -<SP) 

(R4) + 

R3, -<SP> 

(R4) + 

EMTXIT 



i Get index number of primary line 

; Convert to job number 

; Get parent job index number 

; Convert to job number 

i Return primary job number 



/Return parent job number 
; FINISHED WITH EMT 
Branch table used to enter job information routines 
J I JMP X: . WORD J I STAT ; — GET JOB STATE FLAGS 



TSEM2 
JBINFQ • 

172 
173 
174 
175 
176 
177 
178 
179 
ISO 
181 
182 



TSX-Plus EMT Overlay MACRO 
■— Get information about a specific job 



010016 
010020 
010022 
010024 
010026 
010030 
010032 
010034 
010036 
010040 



007564' 
007620 ' 
007640 ' 
007652 ' 
007660 ' 
007672 ' 
007704 ' 
007730 ' 
007736 ' 
007764 ' 



>5. 05 fc 


Wednesday 


18-Jan- 


-89 


10: 


37 


Pag< 


B 38-3 


ic job 


















. WORD 


JIRUN 








. 1 


— GET 




. WORD 


J I MEM 








2 


— GET 




. WORD 


JICONT 








3 


— GET 




. WORD 


JIBASE 








4 


— GET 




. WORD 


JIPROG 








5 


— GET 




. WORD 


JIPPN 








6 


— GET 




. WORD 


JICPU 








7 


— GET 




. WORD 


JIPRIO 








8 


— GET 




. WORD 


J I NAME 








9 


— GET 




. WORD 


JIPAPR 








10 


— GET 


MXJIFN 


= 


«. -JIJMPX 


>/£ 


>-l 







JOB RUN STATE CODE 

AMT OF MEMORY USED BY JOB 

CONNECT TIME FOR JOB 

BASE ADDRESS FOR JOB 

NAME OF PROGRAM BEING RUN 

PROJECT/PROGRAMMER # 

CPU TIME USED BY JOB 

JOB EXECUTION PRIORITY 

JOB NAME 

PARENT AND PRIMARY JOB NUMBERS 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 39 
JBINFO — Get information about a specific job 



1 

2 

3 

4 

5 

6 

7 

8 

9 

10 

11 

12 

13 

14 

15 

16 

17 

18 

19 

20 

21 

22 

23 

24 

25 

26 

27 

28 

29 

30 

31 

32 



Table used 
external ly 



to convert T3X scheduler state codes into 
defined run states. 



10042 
10044 
10046 
10050 
10052 
10054 
10056 
10060 
10062 
10064 
10066 
10070 
10072 
10074 
10076 
10100 
10102 
10104 
10106 
10110 
10112 
10114 
10116 
10120 
10122 
10124 
10126 



OOOG 


001 


OOOG 


001 


OOOG 


001 


OOOG 


002 


OOOG 


003 


OOOG 


004 


OOOG 


005 


OOOG 


006 


OOOG 


007 


OOOG 


010 


OOOG 


Oil 


OOOG 


012 


OOOG 


013 


OOOG 


013 


OOOG 


013 


OOOG 


013 


OOOG 


013 


OOOG 


013 


OOOG 


014 


OOOG 


014 


OOOG 


015 


OOOG 


015 


OOOG 


015 


OOOG 


015 


OOOG 


016 


OOOG 


017 



JIRNST: 



JIRNND: 



. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 
. BYTE 

. EVEN 



S*TWFN, 1 
S*OTLO, 1 
S*IOFN, 1 
S*CPU, 2 
S*LOW, 3 
S*INWT, 4 
S*QTWT, 5 
SSTMWT, 6 
S*SPND, 7. 
S*SFWT, 8. 
S*MSWT, 9. 
StQUSR, 10. 
S*IOWT, 11. 
S*NEDQ, 11. 
S*QMIO, 11. 
S*QCCB, 11. 
S*QSPD> 11. 
S*WSMB, 11. 
S*SPDB, 12. 
S*SPCBi 12. 
S*TTSC, 13. 
SfTTFIM, 13. 
S*OTFN, 13. 
S*HICP, 13. 
S*RT, 14. 
S*WFM, 15. 



Timed 
Termi 
I/O c 
Norma 
Fi xed 
Wai ti 
Wai ti 
Waiti 
Doing 
Share 
Waiti 
Waiti 
Waiti 
Waiti 
Waiti 
Waiti 
Waiti 
Waiti 
Waiti 
Waiti 
Singl 
Non s 
Termi 
Inter 
Fi xed 
Waiti 
End o 



wait comple 
nal output b 
ompletion 
1 priority e 

low priorit 
ng for termi 
ng for termi 
ng for timed 

. SPND 
d file 
ng for 
for 
for 



tion 

uffer almost empty 

xecution 
y execution 
nal input 

nal output buffer space 
interval 



wait 
messa 
ng for USR f 
ng for I/O o 
ng for I/O q 
ng for mappe 
ng for cache 
ng for speci 
ng for syste 
ng for spool 
ng for spool 
e char termi 
ingle char t 
nal buffer e 
active job e 
high priori 
ng for memor 
f table 



9e 

or file operation 

peration 

ueue element 

d I/O buffer 

control block 
al device data base 
m message buffer 
ed device control block 
ed device control block 
nal input complete 
erminal input complete 
mpty 

xecution 
ty 
y expansion 



TSEM2 TSX-Plus EMT Overlay 
Get terminal type code 



1 

2 

3 

4 

5 

6 

7 

8 

9 

10 

11 

12 

13 

14 

15 

16 

17 

18 

19 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 40 



SBTTL Get terminal type code 



This EMT returns in RO a numeric value that 
terminal from which the job is being run. 
The terminal type is declared in the line definition 
by the SET TERMINAL keyboard command. 



indicates the type of 
in TSGEN or 



21 

22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 



10126 
10132 
10136 
10142 
10150 
10152 
10156 
10160 
10162 
10166 
10170 
10172 
10174 
10200 
10202 
10206 



10212 
10214 
10216 
10220 
10222 
10224 
10226 
10230 
10232 
10234 
10236 



012702 
016104 
116100 
032760 
001402 
012704 
020422 
001405 
020227 
101773 
005002 
000403 
162702 
006202 
010237 
000137 



OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 



010212' 
OOOOOOG 
OOOOOOG 
OOOOOOG OOOOOOG 

OOOOOOG 



010236' 



010212' 

OOOOOOG 
OOOOOOG 



10236 
10242 
10246 
10252 
10254 
10260 
10262 



013700 
004737 
016146 
106620 
016146 
106620 
000137 



000002G 
OOOOOOG 
OOOOOOG 

OOOOOOG 

OOOOOOG 



TRMEMT: MOV #LOTRM, R2 

MOV LTRMTP<R1),R4 

MOVB LNPRIM<R1>, RO 

BIT #*V52EM, LSW11 

BEG 1* 

MOV #VT52, R4 

1$: CMP R4, (R2> + 

BEQ 2* 

CMP R2, #HITRM 

BLOS 1* 

CLR R2 

BR 3* 

SUB #LOTRM, R2 

ASR R2 

MOV R2, URO 

JMP EMTXIT 



2*: 



3*: 



i POINT TO START OF TERMINAL TYPE TABLE 
; GET TERMINAL TYPE FLAGS FOR OUR JOB 
> Get out primary line number 
<RO)*Are we emulating a VT52? 
> Br if not 

; Say terminal is a VT52 

; SEARCH FOR MATCHING PATTERN IN TABLE 
; BR IF FOUND 

i HAVE WE SEARCHED ALL OF TABLE? 
iBR IF NOT 
; SAY UNKNOWN TERMINAL TYPE 

; CONVERT TABLE OFFSET TO TERMINAL CODE NUMBER 

; RETURN TERMINAL TYPE CODE # IN USER'S RO 
{FINISHED 



Table to translate terminal type 



LOTRM: 



WORD 
WORD 
WORD 
WORD 
WORD 
WORD 
WORD 
WORD 
WORD 
WORD 



VT52 

VT100 

HAZEL 

ADM3A 

LA36 

LA 120 

DIABLO 

QUME 

VT2007 

VT2008 



flags into code 


number. 


1 - VT52 




2 - VT100 




3 - Hazeltine 




4 - ADM3A 




5 - LA36 




6 - LA120 




7 - Diablo 




8 - Gume 




9 - VT200 with 7 


bit control codes 


- VT200 with 8 


bit control codes 



HITRM: 



SBTTL Get Project-Programmer number 



This emt is used to obtain the current Project-Programmer number 
that a job is running under. 



GETPPN: MOV 
CALL 
MOV 
MTPD 
MOV 
MTPD 
JMP 



GET ADDRESS OF CELL TO RECEIVE PPN 

VALIDATE THE ADDRESS 

MOVE PROJECT # TO USER'S BUFFER 



EMTBLK+2, RO 

VALADW 

LPROJ(Rl), -<SP) 

(R0) + 

LPROG(Ri), ~<5P) 

(R0)+ ; MOVE PROGRAMMER # TO USER'S BUFFER 

EMTXIT i FINISHED 



TSEM2 


TSX-Plus EMT Ov 


er lay 


MISC. TSX EMT'S 

i 

2 
3 






4 

5 
6 
7 
8 


010266 


105737 


OOOOOOG 


9 


010272 


001440 




10 








11 








12 








13 


010274 


020127 


0000000 


14 


010300 


101406 




15 


010302 


020127 


OOOOOOG 


16 


010306 


101003 




17 


010310 


012700 


000002 


IS 


010314 


000425 




19 


010316 


016101 


OOOOOOG 


20 


010322 


013705 


000002G 


21 


010326 


001002 




22 


010330 


010105 




23 


010332 


000411 




24 


010334 


020527 


OOOOOOG 


25 


010340 


101403 




26 


010342 


012700 


000001 


27 


010346 


000410 




28 


010350 


066105 


OOOOOOG 


29 


010354 


114505 




30 


010356 


006205 




31 


010360 


010537 


OOOOOOG 


32 


010364 


001034 




33 


010366 


005000 




34 


010370 


000137 


OOOOOOG 


35 








36 








37 








38 


010374 


006201 




39 


010376 


010137 


OOOOOOG 


40 


010402 


000425 




41 








42 








43 








44 








45 








46 


010404 


105737 


OOOOOOG 


47 


010410 


001417 




48 


010412 


113701 


OOOOOOG 


49 


010416 


001410 




50 


010420 


013700 


OOOOOOG 


51 


010424 


163700 


OOOOOOG 


52 


010430 


070127 


OOOOOOG 


53 


010434 


160100 




54 


010436 


000401 




55 


010440 


005000 




56 


010442 


010037 


OOOOOOG 


57 


010446 


000403 





MACRO V05. 05 Wednesday lS-Jan-89 10:37 Page 41 



. SBTTL MISC. TSX EMT'S 



THE . LNUM EMT RETURNS IN RO THE NUMBER OF THE TSX 

LINE WHICH THE USER IS CONNECTED TO, OR THE LINE NUMBER 

OF THE SPECIFIED SUBPROCESS 



XGTLN: 



TSTB 
BEG 



EMTBLK 
1* 



iWANT CURRENT LINE OR RELATIVE 
i BR IF CURRENT 



THIS IS A REQUEST TO RETURN THE REAL LINE NUMBER OF A SUBPROCESS 



CMP R1,#LSTPL 

BLOS 4* 

CMP R1,#LSTDL 

BHI 4* 

MOV #2, RO 

BR 6* 

4*: MOV LNPRIM(R1),R1 

MOV EMTBLK+2, R5 

BNE 2* 

MOV R1,R5 

BR 3* 

CMP R5> #MAXSEC 

BLOS 5* 

MOV #1,R0 

BR 6* 

ADD LSECPT<R1),R5 

MOVB -<R5),R5 

ASR R5 

MOV R5, URO 

BNE XJNOP 

CLR RO 

JMP SETERR 



2*: 

5*: 
3*: 

6$: 

1*: 



PRIMARY LINE? 



VIRTUAL LINE' 



ARE WE A 

BR IF OK 

ARE WE A 

BR IF OK 

DETACHED JOB'S DON'T HAVE SUBPROCESSES 

GO COMPLAIN ABOUT IT 

GET OUR PARENT INDEX 

WANTS LINE NUMBER FOR THIS SUBPROCESS 

BR IF NOT ASKING FOR PARENT 

COPY PARENT'S PROCESS INDEX 

DON'T NEED SUBPROCESS MAPPING 

VALID SUBPROCESS NUMBER? 

BR IF OK 

SIGNAL INVALID SUBPROCESS # 

AND GO REPORT ERROR 

POINT TO PRIMARY LINE'S SUBPROCESS TABLE 

GET SPECIFIED LINE'S INDEX <^1 IS OFFSET 0) 

CONVERT INDEX TO LINE # 

PASS TO USER 

IF IN USE. RETURN LINE # TO USER 

ELSE REPORT LINE NOT ACTIVE 

RETURN WITH ERROR 



THIS IS A REQUEST TO GET OUR CURRENT LINE NUMBER 



ASR 
MOV 
BR 



Rl 

Rl.URO 

XJNOP 



; CONVERT TO LINE # 

; RETURN TO USER IN RO 



THE . SPLSP EMT RETURNS IN RO THE NUMBER OF FREE BLOCKS OR 
NUMBER OF BLOCKS IN USE IN THE SPOOL FILE. 



XSPLSP: TSTB 


EMTBLK 


BEQ 


1* 


MOVB 


NSPLDV, Rl 


BEQ 


2* 


MOV 


NSPLBL, RO 


SUB 


NFRESB, RO 


MUL 


#PVSPBL, Rl 


SUB 


R1,R0 


BR 


3* 


2*: CLR 


RO 


3*: MOV 


RO, URO 


BR 


XJNOP 



NUMBER OF BLOCKS FREE OF IN USE? 

BR IF NUMBER OF FREE BLOCKS 

GET # OF SPOOLED DEVICES 

BR IF NONE 

GET TOTAL BLOCKS IN SPOOL FILE 

SUBTRACT THE NUMBER OF FREE BLOCKS 

MULTIPLY BY # OF BLOCKS FOR EACH SPOOLED DEV 

AND SUBTRACT FROM BLOCKS IN USE 

RETURN ZERO IF NO SPOOLER 

RETURN # OF BLOCKS IN USE TO USER IN RO 

RETURN 



i 
< 
( 
( 
i 
i 
( 
i 

€ 

i 

( 

€ 

I 

4 

I 

I 

I 

< 

t 

t 

i 



TSEM2 
MISC. 



TSX-Plus 
TSX EMT'S 



EMT Overlay 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 41-1 



58 010450 

59 010456 
60 

61 
62 
63 

64 010462 

65 010466 

66 010470 

67 010476 

68 010504 

69 010506 

70 010514 

71 010522 
72 

73 
74 
75 
76 

77 010524 

78 010530 

79 010532 

80 010536 
81 

82 
83 
84 
85 
86 

87 010542 

88 010546 

89 010550 

90 010554 



013737 

000137 



105737 
001407 
052761 
052761 
000764 
042761 
042761 
000755 



0000000 OOOOOOG 1*: MOV 
OOOOOOG XJNOP: JMP 



NFRESB,URO 
EMTXIT 



; RETURN # OF FREE BLOCKS TO USER IN RO 



OOOOOOG 

OOOOOOG 
OOOOOOG 

OOOOOOG 
OOOOOOG 



005761 OOOOOOG 

001002 

000137 OOOOOOG 

000137 OOOOOOG 



105737 OOOOOOG 

001002 

000137 OOOOOOG 

000137 OOOOOOG 



SET/RESET ODT CHARACTER ACTIVATION MODE 



OOOOOOG 
OOOOOOG 

OOOOOOG 
OOOOOOG 



XODTMD: TSTB EMTBLK 

BEG 1* 

BIS #*0DTMD,LSW4(R1> 

B I S #*DBGMD, LSW6 < R 1 > 

BR XJNOP 

1*: BIC #*ODTMD, LSW4<R1 > ; TURN 

BIC #*DBGMD, LSW6<R1> 

BR XJNOP 



SET OR RESET MODE? 

BR IF RESET 

TURN ON ODT MODE 

SAY WE ARE IN DEBUGGER 



TERMINAL CONTROL MODE 



OFF ODT MODE 
RESET DEBUGGER TERMINAL MODE 



Check to see if any input activation characters are pending. 
Return with c-flag set if not. 



CKINAC: TST 
BNE 
JMP 

1*: JMP 



LACTIV<R1) 

1* 

SETC 

EMTXIT 



i ANY PENDING ACTIVATION CHARS? 

; BR IF YES 

; RETURN WITH C-FLAG SET 

j RETURN WITH C-FLAG CLEAR 



Check to see if we can get site information (license # or site name) 
These are implemented in TSSPL2 which is only loaded if the 
spooling system is enabled. 



SITINF: TSTB 
BNE 
JMP 

1*: JMP 



NSPLDV 
1* 

SETC 
GTLICN 



i Was spooler loaded? 

i Br if so 

» If not* report error immediately 

j Jump to spool2 to execute 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday lS-Jan-89 10:37 Page 42 
MISC. TSX EMT'S 



Set interactive or non-interactive mode for current program. 



4 010560 005737 0000020 

5 010564 001404 
6 
7 
S 
9 010566 042761 0000000 OOOOOOG 

10 010574 000405 

11 

12 

13 

14 010576 052761 OOOOOOG OOOOOOG 1*: 

15 010604 005061 OOOOOOG 
16 
17 
IS 
19 010610 000137 OOOOOOG 



INTEMT: TST 
BEQ 



EMTBLK+2 
1* 



; Set or reset interactive mode? 
; Reset interactive move 



Set interactive mode 



BIC #*NOINT, LSW7(R1>; Clear non-interactive mode flag 
BR 9* 

Reset interactive mode 



#*NOINT, LSW7<Rl)iRun job non-interactively 
LITIME(Rl) > Clear interactive timer 



1*: 






BIS 








CLR 




F 


ini 


shed 


9*: 






JMP 



EMTXIT 



; Finished 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-S9 10:37 Page 43 
Return system (swap) file specification 



1 
2 
3 
4 
5 
6 
7 
8 
9 010614 113705 OOOOOOG 

10 010620 020527 000004 

11 010624 101403 

12 010626 005000 

13 010630 000137 OOOOOOG 
14 

15 
16 

17 010634 006305 

18 010636 016504 010672' 
19 

20 
21 

22 010642 013705 000002G 

23 010646 010500 

24 010650 004737 OOOOOOG 
25 

26 
27 

28 010654 012700 000004 

29 010660 012446 

30 010662 106625 

31 010664 077003 

32 010666 000137 OOOOOOG 
33 

34 
35 

36 010672 OOOOOOG 

37 010674 OOOOOOG 

38 010676 OOOOOOG 

39 010700 OOOOOOG 

40 010702 OOOOOOG 

41 000004 



. SBTTL Return system (swap) file specification 

Return dev: f i Ispc. ex t for system swap files 

The form of the EMT argument block is: 
.BYTE file_index, 164 
. WORD buffer address 



; GET SYSTEM FILE INDEX 

i VALID FILE INDEX NUMBER? 

; BRANCH IF OK 

; ERROR CODE IF BAD INDEX 



Convert system file index number to table offset 



SYFEMT: 


MOVB 


EMTBLK, R5 




CMP 


R5, #MXSYFN 




BLOS 


1* 




CLR 


RO 




JMP 


SETERR 



1*: ASL R5 

MOV SYFTBL(R5),R4 



; CONVERT INDEX TO TABLE OFFSET 
i GET POINTER TO FILE NAME 



MOV 
MOV 
CALL 



EMTBLK+2, R5 
R5, RO 
VALADW 



Get and validate user's return buffer 

i GET USER'S VIRTUAL ADDRESS 
; MAKE SURE ADDRESS IS OK 

Now return 4 RAD50 words of dev: fi lspc. ex t to user buffer 

; MOVE 4 WORDS 
2*: MOV <R4)+, -<SP> i GET NEXT RAD50 WORD 

; MOVE TO USER BUFFER 

i FINISHED 

System file specification pointers 

SYFTBL 



MOV 


#4, RO 


MOV 


<R4)+, -<SP> 


MTPD 


(R5) + 


SOB 


RO, 2* 


JMP 


EMTXIT 



. WORD 
. WORD 
. WORD 
. WORD 
. WORD 



SWDBLK 
SPLBLK 
RSFBLK 
UCLDAT 
INDFIL 



SWAP FILE 

1 SPOOL FILE 

2 PLAS REGION SWAP FILE 

3 USER DEFINED COMMAND (UCL) FILE 

4 IND TEMP FILE 



MXSYFN 



K. -SYFTBL>/2Z 



I 
I 

I 
f 

< 
t 

€ 

€ 
< 

< 

€ 

< 

< 

< 

I 

( 



TSEM2 TSX-Plus EMT Overlay 
Set transmit/receive speed for 



1 

2 

3 

4 

5 

6 

7 

8 

9 

10 

11 

12 

13 

14 

15 

16 

17 

IS 

19 

20 

21 



MACRO V05. 05 
a 1 ine 



Wednesday 18-Jan~89 10:37 Page 44 



010704 



23 

24 

25 

26 

27 

28 

29 

30 

31 

32 

33 

34 

35 

36 

37 

38 

39 

40 

41 

42 

43 

44 

45 

46 
47 

48 
49 
50 
51 
52 
53 
54 
55 
56 
57 



10704 
10710 
10712 
10714 
10716 
10722 
10724 
10730 
10734 
10736 
10744 
10746 
10754 
10756 
10762 



10766 
10774 
10776 
11002 
11004 
11006 
11010 
11014 



11020 
11022 
11030 
11032 



11034 
11040 
11044 
11052 
11054 
11060 
11064 



013702 
006302 
001001 
010102 
020227 
101002 
016202 
020227 
101010 
032762 
001404 
032762 
001404 
012700 
000137 



032737 
001011 
105737 
001402 
020201 
001404 
012700 
000137 



010201 
123727 
002416 
001422 



004737 
042700 
.123727 
001002 
052700 
004737 
000413 



. SBTTL Set transmit/receive speed for a line 

Set transmit/receive speed for a line. 

The form of the EMT argument block is: 
BYTE n, 154 

.WORD line__number 

. WORD speed code 
where n==0 is set speed* n=l is reset xof f , n=2 is set dtr, n=3 is clear dtr 

EMTSPD: 

Get line number and see if it is valid 



0000020 



000000G 

OOOOOOG 
0000000 

OOOOOOG OOOOOOG 

OOOOOOG OOOOOOG 

000002 
OOOOOOG 



OOOOOOG OOOOOOG 
OOOOOOG 



000001 
OOOOOOG 



MOV EMTBLK+2, R2 

ASL R2 

BNE 1* 

MOV R 1 , R2 

1*: CMP R2, #LSTSL 

BHI 10* 

MOV LNPRIM<R2),R2 

10*: CMP R2, #LSTHL 

BHI 5* 

BIT #*HARD, LSW3<R2> 

BEQ 5* 

BIT #*DEAD, LSW3<R2> 

BEQ 4* 

5$: MOV #2, RO 

JMP SETERR 



Get line number 

Convert to line index number 

Br if line number specified 

Use current line 

Primary or virtual line? 

Br if not 

Map virtual line # to real line # 

Is this a valid line number? 

Br if not 

Line connected to hardware? 

Br if not 

Is line installed? 

Br if yes 

Return error code 2 for invalid line # 



See if we are privileged to perform this operation 



4*: 



12*: 



BIT 


#P2*TRM, PRIVC2 


BNE 


11* 


TSTB 


EMTBLK 


BEQ 


12* 


CMP 


R2, Rl 


BEQ 


11* 


MOV 


#1, RO 


JMP 


SETERR 



Do we have privilege to change speed? 

Br if yes 

EMT to reset XOFF status or line speed EMT? 

Br if changing line speed 

Resetting XOFF for our own line? 

Br if yes 

Return error code 1 



OOOOOOG 000001 



MOV 


R2, Rl 


CMPB 


EMTBLK, #1 


BLT 


2* 


BEQ 


20* 



OOOOOOG 
OOOOOOG 
OOOOOOG 000002 

OOOOOOG 
OOOOOOG 



See if this is actually the EMT to reset terminal XOFF status 

11*: MOV R2,R1 ; Get line index number to Rl 

iSet line speed, reset XOFF or DTR? 
;Br if want to set speed 
; Br if want to reset XOFF 

Want to raise or lower DTR> get current data set status 

Get data set status into RO 
Assume we want to lower DTR 
Should we raise DTR? 
Br if not 
Set DTR up bit 
13*: CALL SETDSS > Reset data set status 

And exit 



CALL 


GETDSS 


BIC 


#MS*DTR, RO 


CMPB 


EMTBLK, #2 


BNE 


13* 


BIS 


#MS*DTR, RO 


CALL 


SETDSS 


BR 


30* 



4 

< 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan~S9 10:37 Page 44-1 
Set transmit/receive speed for a line 



58 
59 

60 



Call hardware-dependent routine to set the line speed 



>*: 



MOV 

CALL 

BR 



EMTBLK+4, RO 

SETSPD 

30* 



> Get speed code 

; Set the line speed 

> And exit 



Reset XOFF status and start transmitter 



61 011066 013700 000004G 

62 011072 004737 OOOOOOG 

63 011076 000406 
64 
65 

66 i 

67 011100 042761 OOOOOOG OOOOOOG 20*: BIC #*CTRL5, LSW3(R1 ) ; Reset XOFF flag for line 

68 011106 004777 OOOOOOG CALL ©TRNSTR ;Try to start output to the line 

69 011112 000400 BR 30* ; Finished 

70 i 

71 i Finished 

72 i 

73 011114 000137 OOOOOOG 30*: JMP EMTXIT ; Finished 



TSEM2 TSX-Plus EMT Overlay 
Set transmit/receive speed for 



MACRO V05. 05 
a line 



Wednesday lS-Jan-89 10:37 Page 45 



1 

2 








3 








4 








5 








6 








7 








8 


011120 


012702 


000400 ) 


9 


011124 


012703 


000372 


10 






J 


11 


011130 


113746 


OOOOOOG 


12 


011134 


106623 




13 






i 


14 


011136 


010246 




15 


011140 


106623 




16 


011142 


012700 


000004 


17 


011146 


012704 


OOOOOOG 


18 


011152 


012446 


. 


19 


011154 


106622 




20 


011156 


077003 




21 








22 








23 








24 


011160 


012737 


000350 OOOOOOG 


25 


011166 


000137 


OOOOOOG 



The . GTTAB emt is an obsolete TSX emt that is supposed to return in 
the address of a vector of pointers to tables within TSX. 
This emt is simulated here by moving some info into the low memory 
region of the job <372+) and returning that as the base of the 
pointer vector. 



RO 



XGTTAB: 



1*: 



MOV #400, R2 

MOV #372, R3 
TSLICH — TSX command lead- 

MOVB VTSLCH, -<SP) 

MTPD <R3)+ 
Name of running program. 

MOV R2, -<SP) 

MTPD <R3)+ 

MOV #4, RO 

MOV #RUNDEV, R4 

MOV (R4)+, -<SP) 

MTPD (R2)+ 

SOB RO, 1* 



Tell user that vector is located at 350. 



; STORE VALUES HERE 
i STORE VECTOR HERE 
■in character. 

;GET LEAD-IN CHARACTER 
i MOVE TO JOB SPACE 



SET POINTER TO PROGRAM NAME 

IN VECTOR 

GET # WORDS TO MOVE 

POINT TO NAME OF RUNNING PROGRAM 

MOVE NAME TO JOB SPACE 



MOV 
JMP 



#350, URO 
EMTXIT 



; RETURN VECTOR ADDRESS IN USER 'S RO 
; FINISHED 



TSEM2 TSX-Plus EMT Overlay 
Access TSX system tables 



1 

2 

3 

4 

5 

6 

7 

8 

9 
10 
11 
12 
13 
14 



MACRO V05. 05 Wednesday lB-Jan-89 10:37 Page 46 



. SBTTL Access TSX system tables 



EMT's to get a table value* store a table value, set bits and clear bits. 
Operator privilege is required to modify a table. 

EMT channel byte <byte O in arg block) indicates function desired... 

==> Get value from table. 

1 ==> Store value into table. 

2 ==> Set bits in table. 

3 ~~> Clear bits in table. 

4 --> Special table operation. 



15 O 
16 
17 
IS 

19 

20 

21 

22 




11172 
11176 



11200 
11206 
11210 
11214 



011224 



11230 
11234 
11236 
11240 
11244 
11246 



11252 
11254 



113705 
001412 



032737 
001004 
012700 
000137 
013703 
013702 



OOOOOOG 



TBLEMT: MOVB 
BEG 



EMTBLK, R5 

1* 



i GET SUB-FUNCTION CODE 
i BR IF IT IS GET-VALUE 



Operator privilege is required to modify a table. 



23 
24 
25 
26 
27 

28 011230 020527 000004 

29 

30 

31 011240 020227 000000 

32 

33 011246 000172 011444' 
34 

35 
36 

37 

38 
39 
40 
41 

42 011256 005402 

43 011260 020227 000006 

44 011264 103033 

45 011266 016204 011472' 

46 011272 000406 
47 

48 
49 

50 011274 020227 000024 

51 011300 103025 

52 011302 016204 011446' 

53 011306 060104 
54 

55 
56 
57 011310 120527 000001 



OOOOOOG OOOOOOG 

000001 
OOOOOOG 
000004G 
000002G 



2$: 
1*: 



BIT #PO*SYS, PRIVCO 

BNE 2* 

MOV #1,R0 

UMP SETERR 

MOV EMTBLK+4, R3 

MOV EMTBLK+2, R2 



IS THIS USER PRIVILEGED? 

BR IF YES 

RETURN ERROR CODE OF 1 IF NOT 

; GET VALUE FOR STORE 
;GET TABLE INDEX 



If subfunction code = 4 then branch off to special processing routine 



020527 
001006 
006302 
020227 
101043 
000172 



006302 
002007 



CMP R5, #4 

BNE 11* 

ASL R2 

CMP R2, #MXSPTF 

BHI 9* 

JMP eSPLTF(R2) 



IS THIS A SPECIAL TABLE OPERATION? 

BR IF NOT 

GET WORD TABLE INDEX FOR OPERATION 

MAKE SURE RANGE IS OK 

BR IF INVALID 

ENTER PROCESSING ROUTINE 



This is not a special table function 



11*: 



ASL 
BGE 



R2 
4* 



Negative table index 



NEG 


R2 


CMP 


R2, #MXNGTX 


BHIS 


9* 


MOV 


NEGTAB(R2),R4 


BR 


3* 



; CONVERT TO WORD TABLE VALUE 
j BR IF POS TABLE 



MAKE TABLE INDEX POSITIVE 
IS VALUE TOO BIG? 
BR IF TOO BIG 
GET TABLE ADDRESS 



Positive table index 



4*: 



CMP 


R2, #MXPSTX 


BHIS 


9* 


MOV 


P0STAB(R2),R4 


ADD 


Rl, R4 



IS TABLE INDEX 700 BIG? 
BR IF TOO BIG 
GET TABLE ADDRESS 
INDEX BY LINE NUMBER 



Perform requested operation on table 
3*: CMPB R5, #1 ; CHECK SUB-FUNCTION CODE 



> 



4 
4 
4 
I 
4 
i 



4 



c 

< 

( 
< 

4 

l < 
i 4 

4 

C 
4 
4 
4 



TSEM2 TSX-Plus EMT Overlay 
Access TSX system tables 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 46-1 



58 011314 


003006 




59 011316 


001403 




60 






61 011320 


011437 


OOOOOOG 


62 011324 


000411 




63 






64 011326 


010314 




65 011330 


000407 




66 011332 


020527 


000002 


67 011336 


001002 




68 






69 011340 


050314 




70 011342 


000402 




71 






72 011344 


040314 




73 011346 


000400 




74 






75 






76 






77 011350 


000137 


OOOOOOG 


78 






79 






80 






81 011354 


005000 




82 011356 


000137 


OOOOOOG 


83 






84 






85 






86 






87 






88 011362 


005703 




89 011364 


003403 




90 011366 


020327 


OOOOOOG 


91 011372 


101402 




92 011374 


1 1 3703 


OOOOOOG 


93 011400 


110337 


OOOOOOG 


94 011404 


120361 


OOOOOOG 


95 011410 


103013 




96 011412 


110361 


OOOOOOG 


97 011416 


110361 


OOOOOOG 


98 011422 


032761 


OOOOOOG OOOOOOG 


99 011430 


001403 




100 011432 






101 011440 


000137 


OOOOOOG 


102 






103 






104 






105 011444 


011362' 




106 


000000 




107 






108 






109 






110 011446 


OOOOOOG 




111 011450 


0000000 




112 011452 


OOOOOOG 




113 011454 


OOOOOOG 




114 011456 


OOOOOOG 





BGT 5* 

BEG 6* 

; Fetch table value 

MOV @R4, URO 

BR 10* 

; Store value into table. 

6*: MOV R3, @R4 

BR 10* 

5*: CMP R5, #2 

BNE 7* 

; Set bits in table 

BIS R3, ©R4 

BR 10* 
; Clear bits in table 

7*: BIC R3, @R4 

BR 10* 

Finished 

10*: JMP EMTXIT 
Invalid table index 



;BR IF BIT SET OR RESET 
; BR IF STORE VALUE 

; RETURN TABLE VALUE IN USER'S RO 



; STORE INTO TABLE 

iBIT SET OR RESET? 
; BR IF BIT CLEAR 

;SET BITS 



; CLEAR BITS IN TABLE 



9*: 



CLR 
JMP 



RO 
SETERR 



; RETURN ERROR CODE 



Special table function routines 

1 — Set maximum execution priority for job 



PRIORITY MUST BE > 

BR IF INVALID 

MAY NOT EXCEED THIS 

BR IF OK 

IF BAD, SET TO NORMAL PRIORITY 

SET MAX PRIORITY FOR JOB 

COMPARE WITH CURRENT JOB PRIORITY 

BR IF CURRENT PRIORITY IS OK 

SET BASE PRIORITY FOR JOB 

SET CURRENT PRIORITY FOR JOB 

Is this a subprocess disconnected from term? 

Br if not 

Reduce prio of disconnected subprocess 

FINISHED 



Jump table for special table functions (subfunction code = 4) 

■ o — g e .fc maximum job priority 



SETMXP: 


TST 


R3 




BLE 


1* 




CMP 


R3, #MAXPRI 




BLOS 


2* 


1*: 


MOVB 


VPRIDF, R3 


2*: 


MOVB 


R3, MXJPRI 




CMPB 


R3, LBSPRKR1) 




BHIS 


3* 




MOVB 


R3, LBSPRKR1) 




MOVB 


R3, LPRKR1) 




BIT 


#*VNOTT, LSW<R1) 




BEQ 


3* 




OCALL 


SPPRED 


3*: 


JMP 


EMTXIT 



SPLTF: . WORD 
MXSPTF = 



SETMXP 

<. -SPLTF>~2 



; Table 


of ta 


ble addr 


POSTAB: 


WORD 


LCONTM 




WORD 


LSW 




WORD 


LSW2 




WORD 


LSW3 




WORD 


LSW4 



+00 — CONNECT TIME 
+01 — LSW 
+02 — LSW2 
+03 — LSW3 
+04 — LSW4 



I 

i 

4 
4 
4 
4 
4 
4 
€ 
I 
4 

« 

I 
4 

4 

4 
i 

I 

4 

C 



TSEM2 TSX-Plus EliT Overlay 
Access TSX system tables 



115 
116 
117 
118 

119 
120 
121 

122 
123 
124 
125 
126 
127 



011460 
011462 
011464 
011466 
011470 



011472 
011474 
011476 



OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 
OOOOOOG 
000024 



000000 
OOOOOOG 
000002G 
000006 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 46-2 



+05 — LSW5 
+06 — LSW9 
+07 — LPROJ 
+10 — LPROG 
+11 — LSW2S 



. WORD 


LSW5 


. WORD 


LSW9 


. WORD 


LPROJ 


. WORD 


LPROG » 


. WORD 


LSW2S J 


MXPSTX = 


. -POSTAB 


; Table of add 


resses for negati\ 


NEGTAB: . WORD 


; 


. WORD 


UPPN > 


. WORD 


UPPN+2 > 


MXNGTX = 


. -NEGTAB 



-00 
-01 
-02 



PROJECT # 
PROGRAMMER NUMBER 



000002G 
0000000 
000000G 000002 

000006 

OOOOOOG 
OOOOOOG 



TSEM2 TSX-Plus EMI Overlay 
Get or set user name 

1 
2 
3 
4 
5 
6 
7 

8 011500 010105 

9 011502 013700 

10 011506 004737 

11 011512 123727 

12 011520 002030 

13 011522 012702 

14 011526 070502 

15 011530 062705 

16 011534 105737 

17 011540 001414 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 

40 011602 

41 011604 

42 011610 

43 011612 

44 011616 

45 011620 
46 
47 
48 

49 011622 

50 011624 

51 011626 020527 175000 

52 011632 

53 011634 010561 OOOOOOG 

54 011640 

55 011642 

56 011644 020527 175000 

57 011650 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 47 



. SBTTL Get or set user name 



Get or set user name for this job* or get or set the progam name. 
Byte O indicates whether we are getting the user name (0), setting the 
user name (1), getting the program name (2)* setting the program 
name (3). 



EMUNAM: MOV R1,R5 

MOV EMTBLK+2, RO 

CALL VALADW 

CMPB EMTBLK, #2 

BGE 3* 

MOV #6, R2 

MUL R2, R5 

ADD #LUNAME, R5 

TSTB EMTBLK 

BEG 1* 



GET JOB INDEX NUMBER 

GET ADDRESS OF USER'S BUFFER 

VALIDATE THE ADDRESS 

GET OR SET PROGRAM NAME? 

BR IF GET/SET PROGRAM NAME 

6 WORDS PER USER NAME 

* 12 BYTES PER USER NAME 

POINT TO USER NAME TABLE ENTRY 

IS THIS A REQUEST TO GET OR SET USER NAME 

BR IF GETTING THE NAME 



c 

I 
I 
< 
< 

< 
< 
i 



This is a request to set the user name. 
SETNAME privilege is required to do this. 



011542 
011550 
011552 
011556 
011562 
011564 
011566 
011570 



011572 
011574 
011576 
011600 



032737 
001004 
012700 
000137 
106520 
012625 
077203 
000432 



012546 
106620 
077203 
000426 



003007 
016146 
106620 
016146 
106620 
000416 



106520 
012605 
020527 
103013 
010561 
106520 
012605 
020527 
103004 



OOOOOOG OOOOOOG 

000001 
OOOOOOG 



»*: 



BIT 


#PO*NAM, PRIVCO ; 


BNE 


2* i 


MOV 


#1,R0 ; 


JMP 


SETERR 


MFPD 


(R0> + i 


MOV 


<SP>+, (R5)+ ; 


SOB 


R2, 2* i 


BR 


9* 



IS THIS JOB PRIVILEGED? 

BR IF YES 

RETURN ERROR IF NOT 

GET NEXT WORD OF USER NAME 
MOVE TO SYSTEM TABLE 
LOOP TO MOVE ALL OF NAME 



This is a request to get the user name. 



1*: 



MOV 


<R5)+, 


-(SP) 


MTPD 


<R0) + 




SOB 


R2, 1* 




BR 


9* 





i STACK A WORD OF THE USER NAME 
; MOVE TO USER 'S BUFFER 



This is a request to get or set the program name 



3$: 



OOOOOOG 



OOOOOOG 



BGT 


4* 




MOV 


LPRGKR1), 


-(SP) 


MTPD 


(R0) + 




MOV 


LPRG2(R1), 


-(SP) 


MTPD 


(R0) + 




BR 


9* 





BR IF SETTING 

GET FIRST 3 CHARS OF PROG NAME 

MOVE TO USER'S BUFFER 

GET SECOND 3 CHARS OF PROG NAME 

MOVE TO USER'S BUFFER 



This is a request to set the program name 



4*: 



MFPD 


<R0) + 


MOV 


(SP)+, R5 


CMP 


R5i #175000 


BHIS 


5* 


MOV 


R5, LPRGKR1) 


MFPD 


(R0) + 


MOV 


(SP)+, R5 


CMP 


R5, #175000 


BHIS 


5* 



GET FIRST 3 CHARS 

OF NEW PGM NAME 

IS THIS A VALID RAD50 VALUE 

BR IF NOT 

SET FIRST 3 CHARS OF PROG NAME 

GET SECOND 3 CHARS 

OF NEW PGM NAME 

IS THIS A VALID RAD50 VALUE 

BR IF YES 



i 
i 

€ 

< 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday lS-Jan-89 10:37 Page 47-1 
Get or set user name 

58 011652 010561 OOOOOOG MOV R5, LPRG2(R1) .SET SECOND 3 CHARS OF PROG NAME 

59 011656 000137 OOOOOOG 9*: JMP EMTXIT ; FINISHED 
60 

61 011662 012700 000002 5*: MOV #2, RO > SIGNAL ERROR CODE 

62 011666 000137 OOOOOOG JMP SETERR 



i 



TSEM2 TSX-Plus EliT Overlay 
Request operator privilege 



1 
2 
3 
4 
5 



MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 48 



. SBTTL Request operator privilege 



Request operator privilege. 

This is only legal if user has SYSPRV privilege. 



6 011672 123727 OOOOOOG 000001 REQPRV: CMPB 



7 011700 001417 

8 011702 032737 OOOOOOG OOOOOOG 

9 011710 001410 

10 011712 052737 OOOOOOC OOOOOOG 

11 011720 052761 OOOOOOG OOOOOOG 

12 011726 000137 OOOOOOG 

13 011732 005000 1*: 

14 011734 000137 OOOOOOG 
15 
16 



BEQ 
BIT 
BEQ 
BIS 
BIS 
JMP 
CLR 
JMP 



EMTBLK, #1 ; Request to release locked program? 

2* > Br if yes 

#PO*SPV, PRIVCO ;Does job have SETPRV privilege? 

1$ ; Br if not 

#<PO*SPV!PO*SYS!PO*NAM!PO*BYP>, PRIVCO ; ENABLE PRIVILEGES 

#*PRGLK, LSW5<R1>; Lock program to line 

EMTXIT 

RO i RETURN ERROR CODE OF O 

SETERR 



Release program lock 



17 

18 011740 042761 OOOOOOG OOOOOOG 2*: BIC #*PRGLK, LSW5< Rl >; Program no longer locked to line 

19 011746 000137 OOOOOOG JMP EMTXIT 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 49 
Establish Break key sentinal control 



1 
2 
3 
4 
5 

6 011752 
7 
8 
9 
10 

11 011752 

12 011756 

13 011760 
14 

15 
16 
17 
18 

19 011764 

20 011770 

21 011774 

22 012000 

23 012002 

24 012010 

25 012014 

26 012016 
27 

28 
29 

30 012022 

31 012026 
32 

33 
34 

35 012030 

36 012034 

37 012040 

38 012044 

39 012052 

40 012060 

41 012066 

42 012072 

43 012076 

44 012100 

45 012104 

46 012112 
47 

48 
49 

50 012116 

51 012122 
52 

53 

54 

55 012126 

56 

57 



105737 
001402 
000137 



OOOOOOG 
0000000 



005061 
005037 
016100 
001410 
016037 
005061 
010001 
004737 



005737 
001437 



004737 
113702 
110261 
112761 
116261 
112761 
013700 
004737 
103415 
010061 
013761 
010162 



113700 
010062 



OOOOOOG 
OOOOOOG 
OOOOOOG 

OOOOOOG OOOOOOG 
OOOOOOG 

OOOOOOG 



000004G 



OOOOOOG 
OOOOOOG 
OOOOOOG 

OOOOOOG OOOOOOG 
OOOOOOG OOOOOOG 
OOOOOOG OOOOOOG 
000004G 
OOOOOOG 

OOOOOOG 

OOOOOOG OOOOOOG 
OOOOOOG 



000002G 
OOOOOOG 



SBTTL Establish Break key sentinal control 



Set up control so that pressing the Break key will cause an 
asynchronous completion routine to be entered. 




TSTB 


EMTBLK 


BEQ 


3* 


JMP 


STTCPL 



See if we are connecting a completion routine to a break character 
or to any input activation condition. 

.Connecting to break character? 

iBr if yes 

; Go connect compl to activation condition 

Set completion routine for break character. 

Cancel any existing break control. 

Return address of existing breakpoint routine to user in RO. 

3*: CLR LBRKCH(Rl) ; NO BREAK CHARACTER 

ASSUME NO BREAK ROUTINE NOW 

GET ADDRESS OF BREAK COMPLETION QUEUE ENTRY 

BR IF NONE 

RETURN ADDRESS OF CURRENT BREAKPOINT ROUTINE 

SAY NO COMPLETION ENTRY 

GET ADDRESS OF QUEUE ELEMENT TO Rl FOR QFREE 

RELEASE THE QUEUE ELEMENT 

See if we need to establish a completion routine. 



CLR 


LBRKCH(R.t ) 


CLR 


URO 


MOV 


LBRKCQ<R1>, RO 


BEQ 


1* 


MOV 


CQ*RTN<RO>, URO 


CLR 


LBRKCQ<R1) 


MOV . 


RO, Rl 


CALL 


QFREE 



1*: 



TST 
BEQ 



EMTBLK+4 
2* 



;DID HE SPECIFY THE ADDRESS OF A COMPL RTN? 
; BR IF NOT 



Get a queue element and set up as a completion queue element. 



CALL 

MOVB 

MOVB 

MOVB 

MOVB 

MOVB 

MOV 

CALL 

BCS 

MOV 

MOV 

MOV 



GETQ 

CORUSR, R2 
R2, CQ*J0B<R1> 



; GET A QUEUE ELEMENT 
;GET USER INDEX NUMBER 
; SET JOB NUMBER IN QUEUE ELEMENT 
#S*TWFN, CQ*RNS<R1>;SET EXECUTION STATE 
LPRKR2>,CQ*PRI<R1);SET EXECUTION PRIORITY 
#CP*STD, CQ*CP<R1 >j Set compl routine class priority 



GET ADDRESS OF COMPL ROUTINE 

MAKE SURE ADDRESS IS VALID 

BR IF INVALID 

SET COMPL ROUTINE ADDRESS IN QUEUE ELEMENT 
EMTMAP,CG$PA5<R1);SET EMT ENTRY MAPPING FOR PAR 5 
R1,LBRKCQ(R2> ; SET ADDRESS OF BREAK QUEUE ELEMENT 



EMTBLK+4, RO 

UACHKW 

9* 

RO, CQ*RTN<R1) 



Remember special user-defined break character. 



MOVB EMTBLK+2, RO 
MOV RO, LBRKCH(R2) 



i GET USER -DEFINED BREAK CHARACTER 
i SAVE FOR TT INTERRUPT PROCESSING 



000137 OOOOOOG 



?$ 



Finished 

JMP EMTXIT 
Error — Invalid argument address. 



4 
f 

< 
i 

i 
i 
t 
« 
< 

< 
< 
< 
i 
€ 
i 
< 
< 
i 
4 
i 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 
Establish Break key sentinal control 



Wednesday 18-Jan-89 10:37 Page 49-1 



58 

59 012132 

60 012136 

61 012142 



004737 
012700 
000137 



OOOOOOG 

177766 

OOOOOOG 



9*: 



CALL 


QFREE 


MOV 


#-12, RO 


JMP 


SETERR 



; FREE THE QUEUE ELEMENT 
i SET ERROR CODE 
; ABORT THE EMT 



CHKTT 



TSX-Plus EMT Overlay 
• CHECK I/O TO TT DEVICE 



MACRO V05. 05 Wednesday lS-Jan-89 10:37 Page 50 



1 

2 

3 

4 

5 

6 

7 

8 

9 

10 

11 

12 

13 

14 

15 

16 

17 

18 

19 

20 



SBTTL CHKTT 



CHECK I/O TO TT DEVICE 



CHKTT is called to see if the current I/O operation is being directed 
to device TT or some other device. 



Inputs: 
CHNADR 



Address of current channel block 



Outputs: 
C-flag cleared if I/O is directed to TT 
C-flag set if I/O not directed to TT 



012146 
012152 
012154 
012160 
012162 
012164 
012166 
012170 



017700 
002005 
032700 
001002 
000241 
000207 
000261 
000207 



OOOOOOG 



000076 



CHKTT: 



1*: 



MOV 


©CHNADR, RO 


BGE 


1* 


BIT 


#76, RO 


BNE 


1* 


CLC 




RETURN 




SEC 




RETURN 





GET DEV TABLE INDEX 

BRANCH IF NOT OPEN 

IS THIS TT DEVICE (INDEX # = 0>? 

BR IF NOT TT 

SAY THIS IS TT 



c 



€ 

I 
I 



CKIOST: 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 
CKIOST — See if scheduler wants to stop 1/0 



1 
2 
3 
4 
5 
6 
7 

8 012172 

9 012174 

10 012202 

11 012204 

12 012210 

13 012212 

14 012216 

15 012222 

16 012224 

17 012232 
IS 012236 

19 012240 

20 012244 

21 012250 

22 012254 

23 012256 

24 012262 

25 012270 
26 

27 
28 

29 012274 

30 012276 



Wednesday 18-Jan-89 10: 37 Page 51 



SBTTL CKIOST 



See if scheduler wants to stop I/O 



If the job s 
it can have 
The CKIOST r 
and if so* s 



cheduler wants to stop all I/O for a job so that 
a chance to swap the job. it sets the LIOHLD flag, 
outine checks to see if this flag is set 
uspends the job until all I/O is finished. 



010146 
032737 
001434 
105737 
001031 
113701 
005761 
001424 

105761 
001407 
012700 
004737 
004737 
000760 
005061 

004737 



012601 
000207 



000000G OOOOOOG 

OOOOOOG 

OOOOOOG 
OOOOOOG 

OOOOOOG 

OOOOOOG 
OOOOOOG 
OOOOOOG 

OOOOOOG 

OOOOOOG 



1*: 



3$: 



MOV 

BIT 

BEQ 

TSTB 

BNE 

MOVB 

TST 

BEQ 

DISABL 

TSTB 

BEQ 

MOV 

CALL 

CALL 

BR 

CLR 

ENABL 

CALL 



Finished 



?*: 



MOV 
RETURN 



R 1 , - < SP ) 

#UMODE, EMTPS 

2* 

CURCP 

2$ 

C0RUSR.R1 

LI0HLD<R1) 



LIOCNT<R.t ) 

3* 

#S*IOWT, RO 

QNSPND 

CHKABT 

1* 

LI0HLD<R1) 



SCHED 



<SP)+, Rl 



Was this EMT exec 
Br if yes — Don' 
Was EMT executed 
Br if yes — I/O 
Get current job i 
Is I/O hold flag 
Br if not 
-, ■, *# Disable inte 
» ; Is any I/O in p 
; ; Br if not 
; ; Get I/O wait st 
Enqueue in I/O wa 
See if we were ab 
See if we should 
; ; Reset I/O hold 
*# Enable interru 
Call scheduler to 



uted in kernel mode? 

t stop system EMT's 

by a completion routine? 

hold flag stops cpl rtns 

ndex # 

set for job? 

rrupts ** 
rogress now? 

ate code 

it state <enable ints) 
orted while asleep 
continue waiting 
flag 
pts #* 
probably swap job 



TSEM2 
SETQ 



TSX-Plus EMT Overlay MACRO V05. 
— Do setup of I/O queue element 



1 

2 

3 

4 

5 

6 

7 

8 

9 
10 
11 
12 
13 
14 
15 

16 01 

17 01 
IS 01 
19 
20 

21 



23 
24 



01 
01 
01 

25 01 

26 01 

27 01 

28 01 

29 01 

30 01 

31 01 

32 01 

33 01 

34 01 

35 01 

36 01 

37 01 
38 
39 
40 

41 

42 01 

43 01 

44 01 

45 01 

46 01 

47 01 

48 01 

49 01 

50 01 
51 

52 
53 

54 01 

55 01 

56 01 

57 01 



2300 
2302 
2304 



2306 
2314 
2320 
2324 
2332 
2336 
2342 
2346 
2354 
2360 
2362 
2366 
2372 
2374 
2400 
2404 



2410 
2412 
2416 
2422 
2424 
2426 
2430 
2432 
2434 



2436 
2442 
2444 

2452 



010246 
010346 
010446 



013761 
013703 
010361 
013761 
016302 
042702 
110261 
116361 
113702 
006202 
110261 
020227 
101402 
012702 
072227 
150261 



010100 
062700 
010061 
010302 
012220 
012220 
012220 
012220 
011210 



013702 
001004 
123727 
001104 



05 Wednesday 18-Jan-89 10:37 Page 52 

. SBTTL SETQ — Do setup of I/O queue element 

SETQ is called to set up parameters in an I/O queue element. 

Inputs: 

Rl - Address of queue element 

EMTBLK = EMT arguments 

CHNIMUM = User's channel number 

CHNADR = Address of CSW for channel 

Outputs: 

RO = Highest block number that will be accessed by I/O 

C-flag set if a fatal error is detected (Error code is returned 

URO = Number of words that will be transfered. 



in INTERR) 



SETQ: 



Set 



OOOOOOG OOOOOOG 

0000000 

OOOOOOG 

OOOOOOG OOOOOOG 

OOOOOOG 

177701 

OOOOOOG 

OOOOOOG OOOOOOG 

OOOOOOG 

OOOOOOG 
000037 

000037 
000003 
OOOOOOG 



12*: 



MOV 


R2, -<SP) 


MOV 


R3, -<SP> 


MOV 


R4, -<SP) 


p misc. 


parameters 


MOV 


CHNNUM, Q. CHANCR1 


MOV 


CHNADR, R3 


MOV 


R3, Q. UCSW(Rl) 


MOV 


@#KPAR6, Q. PA6<R1 


MOV 


C. CSW<R3>, R2 


SIC 


#~C76, R2 


MOVB 


R2, Q. DEVX(Rl) 


MOVB 


C. DEVQ<R3>,Q. UNI 


MOVB 


CORUSR, R2 


ASR 


R2 


MOVB 


R2, Q. J0B<R1) 


CMP 


R2, #31. 


BLOS 


12$ 


MOV 


#31. ,R2 


ASH 


#3, R2 


BISB 


R2, Q. JNUM<R1) 



);SET USER'S CHANNEL # 

i GET ADDRESS OF CSW FOR CHANNEL 

i SET POINTER TO CSW 

);Save context blk mapping to access channel 

;GET CHANNEL STATUS WORD 

; EXTRACT DEVICE INDEX NUMBER 

; SAVE IN QUEUE ELEMENT CELL 

T<R1);SET UNIT NUMBER 

; GET USER INDEX # 

; Convert to job number 

i Store job # into queue element 

iWill number fit in old Q. JNUM field? 

; Br if yes 

> Signal that Q. JNUM field not valid 

i Position for Q. JNUM field 

i STORE JOB # 



Copy original channel block into internal channel block that is 
part of I/O queue element. 



OOOOOOG 
OOOOOOG 



000006G 

00000 1G 000032 



MOV R1,R0 

ADD #Q. ICSW, RO 

MOV RO, Q. CSW<R1) 

MOV R3, R2 

MOV (R2)+, <R0>+ 

MOV <R2)+, <R0>+ 

MOV <R2)+, <R0)+ 

MOV <R2>+, <R0>+ 

MOV <R2>, <R0) 

Set up buffer address 

flOV EMTBLK+6, R2 

BNE 5* 

CMPB EMTBLK+1,#32 

BNE 1* 



Get address of I/O queue block 

Get address of CSW within queue block 

Set pointer to internal CSW 

Get pointer to original channel block 

Copy original channel block to internal one 



iGET # WORDS TO BE TRANSFERED 

;BR IF WORD COUNT SPECIFIED 

; IS THIS A . SPFUN REQUEST? 

;BR IF NOT — THIS MUST BE A SEEK REQUEST 



K 



( 



TSEM2 
SETG 



TSX-Plus EMT Overlay 
-- Do setup of I/O queue 



MACRO V05. 05 
element 



Wednesday 18-Jan-89 10:37 Page 52-1 



58 

59 

60 

61 

62 

63 

64 

65 

66 

67 

68 

69 

70 

71 

72 

73 

74 

75 

76 

77 

78 

79 

80 

81 

82 

83 

84 

85 

86 

87 

88 

89 

90 

91 

92 

93 

94 

95 

96 

97 

98 

99 

100 

101 

102 

103 

104 

105 

106 

107 

108 

109 

110 

111 

112 

113 

114 



012454 
012460 
012466 
012470 
012474 
012476 
012504 
012506 
012510 
012512 
012514 
012520 
012522 
012526 
012532 
012536 



012542 
012546 
012552 
012556 
012560 
012562 
012566 
012570 
012574 
012602 
012604 
012606 
012612 
012614 
012620 
012622 
012626 
012632 
012634 
012640 
012642 
012644 
012646 
012650 
012652 
012654 
012660 
012662 
012664 
012670 
012674 
012700 
012704 
012710 



013700 
032737 
001417 
004737 
103523 
123727 
001410 
006302 
005302 
060200 
004737 
103511 
013700 
004737 
010061 
010261 



005037 
013704 
062704 
105004 
000304 
013700 
011302 
042702 
032762 
001007 
060400 
032713 
001424 
042713 
000455 
042713 
005763 
001414 
016302 
020002 
103044 
060400 
020002 
101405 
010200 
163702 
000302 
000402 
013702 
010237 
010261 
013702 
066302 
010261 



000004G 5*: 

OOOOOOG OOOOOOG 

OOOOOOG 

00000 1G 000032 



OOOOOOG 

000004G 
013032' 
OOOOOOG 
OOOOOOG 



OOOOOOG 
000006G 
000377 



2*: 



MOV EMTBLK+4, RO 

BIT #UMODE, EMTPS 

BEQ 2$ 

CALL UACHKB 

BCS 9* 

CMPB EMTBLK+1,#32 

BEQ 2* 

ASL R2 

DEC R2 

ADD R2, RO 

CALL UACHKB 

BCS 9* 

MOV EMTBLK+4, RO 

CALL CVTUAD 

MOV RO, Q. BUFFtRl) 

MOV R2, G. PAR(Rl) 



BASE ADDRESS OF BUFFER AREA 

WAS EMT DONE IN USER OR KERNEL MODE? 

BR IF IN KERNEL MODE < ASSUME ADDRESS IS OK) 

MAKE SURE IT IS LEGAL 

BR IF ILLEGAL 

IS THIS A . SPFUN OPERATION? 

BR IF YES — DON'T CHECK WORDCOUNT VALUE 

CVT # WORDS TO # BYTES 

GET ADDRESS OF LAST BYTE TRANSFERED 

CHECK HIGH RANGE ADDRESS OF BUFFER 

BR IF ILLEGAL 

GET BACK BASE ADDRESS OF BUFFER 

CONVERT USER ADDRESS TO PHYSICAL ADDRESS 

BUFFER ADDRESS RELATIVE TO Q. PAR 

RELOCATION BASE ADDRESS 



Set up word count and block number for transfer. 



000002G 

177701 

OOOOOOG OOOOOOG 



OOOOOOG 

OOOOOOG 

OOOOOOG 
OOOOOOG 

OOOOOOG 



000002G 



000006G 
OOOOOOG 
OOOOOOG 
000002G 
OOOOOOG 
OOOOOOG 



CLR URO 

MOV EMTBLK+6, R4 

ADD #377, R4 

CLRB R4 

SWAB R4 

MOV EMTBLK+2, RO 

MOV <R3),R2 

BIC +TC76, R2 

BIT #DS*D I R , DVSTAT < I 

BNE 10* 

ADD R4, RO 

BIT #C5*E0F, (R3> 

BEQ 1* 

BIC #CS*EOF, <R3) 

BR 7* 

10*: BIC #CS*EOF, <R3) 

TST C. SBLK<R3) 

BEQ 1* 

MOV C. LENG<R3),R2 

CMP RO, R2 

BHIS 8* 

ADD R4, RO 

CMP RO, R2 

BLOS 1* 

MOV R2, RO 

SUB EMTBLK+2, R2 

SWAB R2 

BR 3* 

1*: MOV EMTBLK+6, R2 

3*: MOV R2, URO 

MOV R2, Q. WCNT<R1) 

MOV EMTBLK+2, R2 

ADD C. SBLK<R3), R2 

MOV R2, Q. BLKN(Rl) 



SAY # WORDS TRANSFERED = O 
GET WORD COUNT 
CONVERT TO BLOCK COUNT 



(IN CASE OF ERROR) 



GET BLOCK # FOR REQUEST 

GET CSW 

GET DEVICE INDEX 

!); IS THIS A FILE STRUCTURED DEVICE? 

BR IF YES 

COMPUTE HIGH BLOCK NUMBER FOR TRANSFER 

HAS END OF FILE BEEN HIT? 

BR IF NOT 

ACKNOWLEDGE EOF 

RETURN EOF STATUS CODE 

CLEAR END OF FILE FLAG 

STARTING BLOCK FOR FILE = O? 

DIR OP IF YES 

GET # BLOCKS ALLOCATED FOR FILE 

IS THIS A VALID STARTING BLOCK #? 

BR IF INVALID STARTING BLOCK # 

COMPUTE ENDING BLOCK NUMBER + 1 

WILL TRANSFER PASS END OF FILE? 

BR IF WITHIN FILE 

DON'T PASS END OF FILE 

CALCULATE # BLOCKS ACTUALLY TO BE TRANSFERRED 

GET ACTUAL WORD COUNT FOR TRANSFER 

GET REQUEST WORD COUNT 

RETURN ACTUAL WORD COUNT TO USER IN RO 

SET WORD COUNT IN Q ELEMENT 

GET REQUEST BLOCK # 

ADD BASE BLOCK # OF FILE 

SET PHYSICAL BLOCK # 



€ 

« 



012714 126137 OOOOOOG OOOOOOG 



See if this is an I/O operation to a logical disk 

CMPB Q. DEVX(Rl), LDDEVX; I/O TO LOGICAL DISK? 



4 
< 



SETQ 



TSX-Plus EMT Overlay MACRO V05. 05 
— Do setup of I/O queue element 



115 
116 
117 

lie 

119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 
141 
142 



012722 
012724 
012726 
012734 
012736 
012740 
012742 

012744 
012752 

012754 

012754 
012760 



012770 
012772 
012774 
012776 



001006 
010046 

012600 
103406 
000241 
000407 

112737 
000402 



105037 
000261 



012762 016361 



012604 
012603 
012602 
000207 



Wednesday 


18-Jan-89 


BNE 


11* 


MOV 


RO, -(SP) 


OCALL 


LDIO 


MOV 


(SP)+, RO 


BCS 


8* 



10: 37 Page 52-2 



11*: 



CLC 

BR 4* 
i Invalid buffer address 
177766 OOOOOOG 9*: MOVB #-12, INTERR 

BR 6* 
; Invalid block number (return EOF status) 
8*: 



BR IF NOT 

SAVE HIGH BLOCK NUMBER 

ALTER QUEUE ELEMENT FOR LOGICAL DISK I/O 

RESTORE HIGH BLOCK NUMBER 

BR IF NOT VALID LOGICAL DISK 

SIGNAL SUCCESS ON RETURN 



RETURN ERROR CODE 12 



OOOOOOG 



7*: 
6*: 



BIS 

CLRB 

SEC 



#CS*EOF, (R3) 
INTERR 



SET END-OF-FILE FLAG IN CSW 
RETURN ERROR CODE OF O 
SIGNAL ERROR ON RETURN 



Copy Channel Status Word from user's channel status block into 
internal CSW word in I/O queue element (Q. ICSW). 
(Note, Do not alter C-~flaq) 



OOOOOOG OOOOOOG 4*: MOV 

> 

» Finished 



C. CSW(R3), Q. ICSW(R1 ); Copy CSW into Q element 



MOV 


(SP>+, R4 


MOV 


(SP)+, R3 


MOV 


<SP)+, R2 


RETURN 





TSEM2 
SETCR 



TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-S9 10:37 Page 53 
— Set completion routine address in queue element 



1 
2 
3 
4 
5 
6 
7 

a 

9 
10 
11 
12 

13 013000 020027 000001 SETCR: 

14 013004 101403 

15 013006 004737 0000000 

16 013012 103406 

17 013014 010061 OOOOOOG 2*: 
IS 013020 013761 OOOOOOG OOOOOOG 

19 013026 000241 

20 013030 000207 1*: 



SBTTL SETCR 



Set completion routine address in queue element 



SETCR is called to store a completion routine address into an 
I/O queue element. 



Inputs: 
RO = Completion routine address 
Rl = Address of I/O queue element 



Outputs: 
c~flag set if 



fatal error is detected. 



CMP 


RO, #1 


BLOS 


2* 


CALL 


UACHKW 


BCS 


1* 


MOV 


RO, Q. CQMP<R1> 


MOV 


EMTMAP,Q. PA5( 


CLC 




RETURN 





; COMPL RTN ADDR OF 1 ==> . READW/. WRITW 

; BR IF YES 

i VALIDATE ADDRESS OF COMPLETION ROUTINE 

i BR IF ILLEGAL 

; STORE ADDRESS INTO QUEUE ELEMENT 

i SET EMT ENTRY PAR 5 MAPPING VALUE 

i SIGNAL GOOD RETURN 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday i8-Jan-39 10:37 Page 54 
CVTUAD — Convert user address to physical address 



€ 
€ 



i 

2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
IS 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 



013032 
013034 
013036 



013042 
013050 



013052 
013060 
013062 
013066 
013070 
013074 
013076 
013100 
013104 
013106 
013114 
013116 
013122 
013124 



010146 
010346 
113701 



032737 
001455 



032761 
001405 
020027 
103051 
162700 
010003 
005002 
073227 
006302 
032761 
001006 
005762 
001413 
016202 



. SBTTL CVTUAD — Convert user address to physical address 

CVTUAD is called to convert a user specified virtual buffer address into 
the corresponding physical address. 

The type of conversion done depends on whether the EMT was executed in 
user or kernel mode: 

User mode EMT: 
The address is assumed to be within the job's virtual address region. 

Kernel mode EMT: 

1. If the virtual address is greater than or equal to 140000 it is mapped 
into the job's context block. 

2. If the virtual address is greater than or equal to 120000 it is mapped 
into the system mapped region using the value of EMTMAP which contains 
the mapping value that kernel PAR 5 had when the EMT was executed. 

3. If the virtual address = it is mapped to the base of the program 
space. (Used for reading in SAV files). 

4. Otherwise the address is assumed to already be physical and is returned 
unchanged. 

If the address needs to be mapped* the virtual address returned will be 
in the range 140000-157777 so that it will map through page 6. 

Inputs: 
RO = Virtual address to be mapped. 

Outputs: 
RO = 16-bit offset within page. 
R2 = PAR page base. 



0000000 



OOOOOOG OOOOOOG 



CVTUAD: MOV 
MOV 
MOVB 



R 1 , - < SP ) 
R3, -<SP) 
C0RUSR,R1 



i GET JOB INDEX NUMBER 
Determine if the EMT was done in user or kernel mode. 



BIT #UMODE, EMTPS 
BEQ 1* 



j WAS EMT DONE IN USER OR KERNEL MODE? 
; BR IF IN KERNEL MODE 



EMT was done in user mode. 

Map user virtual address to physical address. 



OOOOOOG OOOOOOG 

OOOOOOG 

OOOOOOG 

000003 

OOOOOOG OOOOOOG 

OOOOOOG 

OOOOOOG 



8*: 



BIT 


#*INKMN»LSW4<R1> 


BEQ 


8* 


CMP 


RO, #CXTBAS 


BHIS 


5* 


SUB 


#KMNBAS, RO 


MOV 


RO, R3 


CLR 


R2 


ASHC 


#3, R2 


ASL 


R2 


BIT 


#*UDSPC,L5W1KR1 


BNE 


4* 


TST 


RPDR<R2) 


BEQ 


6* 


MOV 


RPAR(R2)>R2 



IS KMON RUNNING? 

BR IF NOT 

IS KMON DOING I/O TO JOB CONTEXT AREA? 

BR IF YES 

SUBTRACT KMON ADDRESS BIAS 

GET VIRTUAL ADDRESS 

CLEAR FOR SHIFT 

GET PAR VALUE FROM ADDRESS 

CONVERT TO WORD INDEX 

; Has user enabled I/D split? 
Check D-space if so 

IS THIS I-space PAGE SPECIALLY MAPPED? 
BR IF NOT 
GET BASE 64-BYTE BLOCK # FOR THIS PAGE 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-S9 10:37 
CVTUAD — Convert user address to physical address 



58 

59 

60 

61 

62 

63 

64 

65 

66 

67 

68 

69 

70 

71 

72 

73 

74 

75 

76 

77 

78 

79 

80 

81 

82 

83 

84 

85 

86 

87 

88 

89 

90 

91 

92 

93 

94 

95 

96 

97 

98 

99 

100 

101 

102 

103 

104 

105 

106 

107 

108 

109 

110 

111 

112 

113 

114 



013130 
013132 
013136 
013140 
013144 
013150 
013152 
013156 
013160 
013162 
013164 
013170 
013172 
013176 
013202 



013204 
013210 



013212 
013216 



013224 
013230 



013232 
013236 
013242 



013244 
013246 



013250 
013254 
013260 



013262 
013264 



000405 
005762 
001405 
016202 
042700 
000402 
016102 
010003 
000241 
006003 
072327 
060302 
042700 
062700 
000440 



013222 000430 



020027 
103405 



010002 
000241 



OOOOOOG 

OOOOOOG 
160000 

OOOOOOG 



177773 

177700 
OOOOOOG 



020027 OOOOOOG 
103405 



016102 OOOOOOG 
072227 000003 



OOOOOOG 



013702 OOOOOOG 
062700 020000 
000420 



005700 
001005 



016102 OOOOOOG 
062700 OOOOOOG 
000411 



4$: 



10*: 

6*: 
7$: 



BR 10* 

TST RDDR<R2> 

BEG. 6* 

MOV RDAR<R2),R2 

BIC #160000, RO 

BR 7* 

MOV LPARBS<R1>, R2 

MOV R0> R3 

CLC 

ROR R3 

ASH #-5, R3 

ADD R3, R2 

BIC #~C77, RO 

ADD #VPAR6, RO 

BR 9* 



Page 54-1 



> Go clean up virtual address 

; Is this D-space PAR specially mapped? 

; Br if not) use root memory 

> If address in special D-space* get PAR 

; CLEAR PAR # FROM VIRTUAL ADDRESS 

GET BASE 64-BYTE BLOCK # FOR JOB 

GET VIRTUAL ADDRESS 

SHIFT RIGHT 6-BITS WITHOUT SIGN EXTENSION 



GET 64-BYTE BLOCK # OF PHYSICAL ADDRESS 
GET BYTE-WITHIN-BLOCK FROM VIRTUAL ADDRESS 
MAP INTO PAR6 REGION 



EMT was done in kernel mode. 
Determine which region to map to. 



1*: 



CMP 

BLO 



RO, #CXTBAS 
2* 



; IS ADDRESS IN JOB CONTEXT BLOCK? 
; BR IF NOT 



Map to Job context block. 



5*: 



MOV 
ASH 



i GET BASE 256-WORD BLOCK # OF CONTEXT BLOCK 
; CONVERT TO 32-WORD BLOCK # 
Note: Virtual address in RO is already in PAR 6 range (140000-157777). 
BR 9* 



LBASE(Rl), R2 
#3, R2 



See if accessing the system mapped region. 



?*: 



CMP 
BLO 



RO, #VPAR5 
12* 



; IS ADDRESS IN MAPPED SYSTEM REGION? 
; BR IF NOT 



Map to the buffer using the current contents of EMTMAP which indicates 
the mapped value for kernel PAR 5 when the EMT was done. 



MOV 
ADD 
BR 



EMTMAP, R2 
#20000, RO 
9* 



; Get mapping value that PAR 5 had on entry 
; INCREASE VIRTUAL ADDRESS 



Not in job context area. 

See if accessing base of job region. 



12*: 



TST 
BNE 



RO 
3* 



Map to base of job space. 

MOV LPARBS<R1),R2 

ADD #VPAR6, RO 

BR 9* 

Address is already physical. 

3*: MOV RO, R2 
CLC 



i VIRTUAL ADDRESS = O? 
i BR IF NOT 



; GET PAR OF JOB BASE 

;PUT VIRTUAL ADDRESS IN PAGE 6 REGION 



; GET ACTUAL ADDRESS 
i CONVERT TO PAGE # 



i 

< 
« 

< 

< 

i 
i 

i 
i 
< 
i 
i 
i 
i 

i 
< 

< 
i 
( 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday lS-Jan-89 10:37 Page 54-2 
CVTUAD — Convert user address to physical address 



115 


013266 


006002 




116 


013270 


072227 


177773 


117 


013274 


042700 


177700 


US 


013300 


062700 


0000000 


119 








120 








121 








122 


013304 


012603 




123 


013306 


012601 




124 


013310 


000207 





9*: 



ASH 


#-5»R2 


BIC 


#--"C77, RO 


ADD 


#VPAR6, RO 


Fini shed 




MOV 


(SP)+, R3 


MOV 


<SP)+, Rl 


RETURN 





i GET BYTE-IN-PAGE TO RO 
; MAP THROUGH PAR 6 



TSEM2 


TSX-Plus EMT Ov 


erlay 


< LDIO 

1 

< 2 

3 


— Process I/O t 


o logica 








4 








< 5 








6 








7 








< 8 








9 








10 








* 11 








12 








13 


013312 


010446 




< 14 








15 








16 








< 17 








IS 


013314 


116104 


OOOOOOG 


19 


013320 


042704 


177770 


f 20 


013324 


006304 




21 


013326 


016400 


OOOOOOG 


22 


013332 


001456 




* 23 


013334 


110061 


OOOOOOG 


24 


013340 


142761 


000007 


25 


013346 


000300 




< 26 


013350 


150061 


OOOOOOG 


27 








28 








i 29 








30 


013354 


116100 


OOOOOOG 


31 


013360 


002023 




i 32 


013362 


105061 


OOOOOOG 


33 


013366 


120027 


000372 


34 


013372 


001006 




1 35 


013374 


005737 


000006G 


36 








37 








i 38 








39 


013400 


000240 




40 


013402 


004737 


013476' 


i 41 


013406 


000426 




42 


013410 


120027 


000373 


43 


013414 


001023 




< 44 


013416 


016446 


OOOOOOG 


45 


013422 


106677 


000004G 


46 


013426 


000416 




i 47 








48 








49 








i 50 








51 


013430 


016100 


OOOOOOG 


52 


Q 13434 


062700 


000377 


< 53 


013440 


105000 




54 


013442 


000300 




55 


013444 


066100 


OOOOOOG 


* 56 


013450 


020064 


OOOOOOG 


57 


013454 


101005 





MACRO V05. 05 
L disks 



Wednesday 18-Jan-89 10: 37 Page 55 



. SBTTL LDIO 



— Process I/O to logical disks 



LDIO is called from the SETQ routine in TSEMT when it determines 
that the queue element being set up is for an I/O operation to 
a logical disk. 

This routine converts the logical device #, unit #» and block # 
into a physical device #, unit #, and block #. 



Inputs: 
Rl = Address of I/O queue element 
EMTBLK = Current EMT argument block 



LDIO: 



MOV 



R4, -<SP> 



Change logical device number and unit number into physical 
device number and unit number. 



GET LOGICAL DISK UNIT NUMBER 

GET UNIT # ONLY 

CONVERT TO WORD TABLE INDEX 

GET PHYSICAL UNIT # AND DEVICE # 

BR IF THIS LOGICAL UNIT NOT IN USE 

SET PHYSICAL DEVICE INDEX NUMBER 

CLEAR OLD UNIT # 

GET PHYSICAL UNIT # TO LOW BYTE 

SET PHYSICAL UNIT # 



See if this is a . SPFUN to get device size or LD unit tables 



MOVB 


Q. UNIT<R1),R4 


BIC 


# A C7, R4 


ASL 


R4 


MOV 


LDPDEV(R4),R0 


BEG. 


2* 


MOVB 


RO, Q. DEVX<R1> 


BICB 


#7,0. UNIT<R1) 


SWAB 


RO 


BISB 


RO, 0. UNIT<R1> 



MOVB 

BGE 

CLRB 

CMPB 

BNE 

TST 



G. FUNC<R1),R0 

1* 

Q. DEVX(Rl) 

RO, #372 

5* 

EMTBLK+6 



IS THIS A . SPFUN REQUEST? 

BR IF NOT 

TELL QIO NOT TO DO ANY ACTUAL I/O 

IS THIS FUNCTION TO GET DEVICE TABLE? 

BR IF NOT 

IS THIS A REQUEST TO UPDATE HANDLER TABLE? 
RT VS. 4 changed logic to: -went as write, +wcnt as read 
Remove the next line to alwaus read (-went and +wcnt ==> read) 

IGNORE IT IF YES 

Reserve room to patch BR back in if needed 

PASS DEVICE TABLE INFO TO USER 

FINISHED 
5$: CMPB RO, #373 i IS THIS FUNCTION TO GET DEVICE SIZE? 

BR IF NOT — IGNORE ALL OTHER SPECIAL FUNCTS 
•<SP);GET LOGICAL DISK SIZE 

MOVE INTO USER'S BUFFER 

FINISHED 

Check to make sure that the transfer is completely within the 
area of the logical disk. 

1$: MOV Q. WCNT(R1),R0 i GET WORD COUNT FOR TRANSFER 

; CONVERT TO BLOCK COUNT 



BPL 


4* 


Nur 
CALL 


LDRST 


BR 


4* 


CMPB 


RO, #373 


BNE 


4* 


MOV 


LDSIZE<R4>, 


MTPD 


©EMTBLK+4 


BR 


4* 



MOV 


Q. WCNT(R1),R0 


ADD 


#377, RO 


CLRB 


RO 


SWAB 


RO 


ADD 


Q. BLKN<R1),R0 


CMP 


RO, LDSIZE(R4) 


BHI 


2* 



ADD TRANSFER STARTING BLOCK NUMBER 
IS TRANSFER WITHIN LOGICAL DISK? 
BR IF NOT 



i 
i 

i 

4 

< 

i 
i 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan--89 10:37 Page 55-1 
LDIO — Process I/O to logical disks 



58 
59 
60 



; Bias logical block number by base block of logical disk file 
ADD LDBASE<R4>, Q. BLKN(Rl) ;BIAS BLOCK NUMBER 



61 013456 066461 OOOOOOG OOOOOOG 

62 i 

63 ' Transfer is ready to go 

64 ; 

65 013464 000241 4*: CLC ; SIGNAL SUCCESS ON RETURN 

66 013466 000401 BR 3* 

67 ; 

68 > End of file hit by transfer 

69 ; 

70 013470 000261 2*: SEC i SIGNAL ERROR ON RETURN 

71 i 

72 i Finished 

73 i 

74 013472 012604 3*: MOV <SP>+, R4 

75 013474 000207 RETURN 



i 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 
LDIO — Process I/O to logical disks 



Wednesday iS-Jan-89 10: 37 Page 56 



3 

4 

5 

6 

7 

8 

9 
10 
11 
12 
13 
14 
15 
16 
17 
18 

19 013476 

20 013500 

21 013502 
22 

23 
24 

25 013504 

26 013510 

27 013516 

28 013520 

29 013524 

30 013526 

31 013532 

32 013534 

33 013536 

34 013542 

35 013544 

36 013550 

37 013556 

38 013560 

39 013566 

40 013570 

41 013574 

42 013576 

43 013602 

44 013604 

45 013606 

46 013612 

47 013616 
48 

49 
50 

51 013620 

52 013624 

53 013630 

54 013632 

55 013634 
56 

57 



010246 
010346 
010446 



013702 
123727 
001406 
012746 
106622 
012746 
106622 
005003 
016300 
001417 
052700 
032763 
001411 
123727 
001403 
052700 
000402 
052700 
010046 
106622 
062703 
020327 
103747 



012704 
012700 
012446 
106622 
077003 



tables with 



Process the Logical Disk special function code 372 
pass the LD data tables to the user. 
The information returned consists of 4 
table for each logical disk unit (0-7) 
The four tables are: 

unit) 

is allocated 

is read-only 

number mask 



that is used to 
one entry in each 



FLAGS (1 word per 

100000 = Unit 

020000 = Unit 

003400 = Unit 

000076 = Device index number mask 
OFFSET (1 word per unit) 

Starting block number of logical disk on real disk. 
SIZE <1 word per unit) 

Number of blocks allocated for logical disk. 
NAME (4 words per unit) 

File spec for logical disk file. 



LDRST: 



MOV 
MOV 
MOV 



R2, -<SP) 
R3, -<SP) 
R4, -<SP) 



0000040 
OOOOOOG 

045640 

OOOOOOG 

OOOOOOG 

100000 
OOOOOOG 



000001 



OOOOOOG 



OOOOOOG 000001 

040000 

020000 



000002 
OOOOOOG 



Pass flag table info to user 



MOV EMTBLK+4, R2 

CMPB LDVERS, #1 

BEG 11* 

MOV #~RLD , -<SP) 

MTPD (R2)+ 

MOV #MAXLD, -<SP) 

MTPD <R2)+ 

11*: CLR R3 

1*: MOV LDPDEV<R3),R0 

BEG 2* 

BIS #100000, RO 

BIT #LD*RON, LDFLAG 

BEG 2* 

CMPB LDVERS, #1 

BEG 22* 

BIS #040000, RO 

BR 2* 

BIS #020000, RO 

MOV RO, ~<SP) 

MTPD (R2)+ 

ADD #2, R3 

CMP R3, #MAXLD#2 

BLO 1* 



Get address of user's buffer 
LD version format 5. 3& earlier? 
Skip first two words if old format 
Pass LD device name to user 

i Pass number of LD units to user 



22*: 
2*: 



OOOOOOG 
OOOOOOG 



; Offset info table 

MOV #LDBASE, R4 

MOV #MAXLD, RO 

3*: MOV <R4)+, -<SP) 

MTPD (R2)+ 

SOB RO, 3* 

i 

i Size info table 



i Init LD index 

; Get real disk device # and unit # 
; Br if unit is not allocated 
;Set unit-allocated flag in status 
(R3); Is the unit read-only? 
j Br if not read-only 
i LD version format 5. 3& earlier? 
i Use old mask for old format 
iSet read-only status flag (5. 4&later) 

} Set read-only status flag (5. 3&earlier) 

) Pass status flags to user 

> Increment unit index 
i Done al 1 units? 
> Br if more to do 



;Point to table with base values for disks 
i Get number of units 
;Pass offset info to user 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 
LDIO — Process I/O to logical disks 



Wednesday lS-Jan-89 10: 37 Page 56-1 



58 

59 013636 

60 013642 

61 013646 

62 013650 

63 013652 
64 

65 
66 

67 013654 

68 013660 

69 013664 

70 013666 

71 013670 
72 

73 
74 

75 013672 

76 013674 

77 013676 

78 013700 



012704 
012700 
012446 
106622 
077003 



012704 
012700 
012446 
106622 
077003 



012604 
012603 
012602 
000207 



OOOOOOG 
0000000 



4*: 



MOV 


#LDSIZE, R4 


MOV 


#MAXLD, RO 


MOV 


<R4)+, -<SP> 


MTPD 


<R2> + 


SOB 


RO, 4* 



iPoint to table with size info 

; Get # LD units 

; Pass size info to user 



File name table 



OOOOOOG 
OOOOOOC 



MOV 
MOV 
5*: MOV 
MTPD 
SOB 

; Finished 

MOV 
MOV 
MOV 
RETURN 



#LDNAME, R4 
#MAXLD#4, RO 
<R4)+> -<SP> 
(R2) + 
RO, 5* 



(SP)+, R4 
(SP)+, R3 
<SP>+, R2 



; Point to table with file name info 
; Get # words to move 
j Pass info to user 



< 
i 

< 
< 

< 
i 
I 
I 
I 
I 
i 
( 

€ 
I 
i 

< 
i 
i 
4 
4 
< 



TSEM2 
INDIO 



TSX-Plus EMT Overlay 
— Perform I/O for IND 



MACRO V05. 05 
data segment 



Wednesday lS-Jan-S9 10: 37 Page 57 



1 

2 

3 

4 

5 

6 

7 

S 

9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 

25 013704 

26 013712 

27 013714 

28 013722 
29 

30 
31 
32 

33 013724 

34 013732 

35 013734 

36 013742 

37 013744 
38 

39 
40 
41 

42 013752 

43 013754 

44 013756 

45 013760 

46 013764 

47 013770 

48 013774 

49 014000 
50 

51 
52 

53 014004 

54 014006 



013702 010546 



023727 
001034 
023737 
001030 



032761 
001007 
123727 
001420 
052761 



010105 
006205 
005305 
070537 
010537 
013703 
062703 
010337 



012605 
000207 



. SBTTL INDIO — Perform I/O for IND data segment 

INDIO is called for each Read and Write operation when IND is running. 
It determines if the read/write is directed to the IND data segment 
overlay and if so* redirects it to the appropriate position in the 
INDTMP. TSX file. 

This is done by altering the block number in EMTBLK and changing 
CHNADR to point to a channel block that is opened to the INDTMP file. 

Inputs: 
Rl = Job index number 
CHNNUM = Channel number 
CHNADR = Address of CSW for channel 

Outputs: 
If I/O is redirected to INDTMP file... 
R3 = Address of channel block for INDTMP file. 
CHNADR = Address of channel block for INDTMP file. 
EMTBLK+2 = Block # in INDTMP file of area for data segment for this job. 

INDIO: MOV R5, -<SP> 

Determine if this I/O is directed to the IND data segment overlay 



0000000 000017 
000002G 000000G 



CMP CHNNUM, #17 

BNE 9* 

CMP EMTBLK+2, INDDBL 

BNE 9* 



IS I/O BEING DONE TO IND. SAV FILE? 
BR IF NOT 

ARE WE ACCESSING DATA SEGMENT OVERLAY? 
BR IF NOT 



OOOOOOG OOOOOOG 
00000 1G 000010 
OOOOOOG OOOOOOG 



IND is accessing its data segment overlay. 

Determine if the data segment has been written to the temp file yet. 

BIT #*INDDW> LSW6(Rl)i HAS DATA SEGMENT BEEN WRITTEN TO TEMP FILE? 

BNE 1* i BR IF YES 

CMPB EMTBLK+1,#10 > IS THIS A READ OR WRITE REQUEST? 

BEG. 9* iBR IF READ — GO TO SAV FILE TILL 1ST WRITE 

BIS #*INDDW, LSW6(R1>> REMEMBER 1ST WRITE HAS BEEN DONE TO TEMP FILE 

Change info to cause I/O to be directed to SY: INDTMP. TSX file. 

The position within the INDTMP file is a function of the Job index #. 



1$: 



OOOOOOG 
000002G 
OOOOOOG 
OOOOOOG 
OOOOOOG 



MOV 
ASR 
DEC 
MUL 
MOV 
MOV 
ADD 
MOV 

Finished 



9$: 



MOV 
RETURN 



R1,R5 

R5 

R5 

INDDBS, R5 

R5, EMTBLK+2 

CXTRMN, R3 

#R*INTC,R3 

R3, CHNADR 



<SP>+, R5 



GET JOB # 

DIVIDE BY 2 

MAKE RELATIVE TO O 

TIMES # OF BLOCKS IN THE OVERLAY SEGMENT 

REPLACE BLOCK # FOR I/O OPERATION 

GET ADDRESS OF JOB'S SIMULATED RMON 

POINT TO CHANNEL BLOCK FOR INDTMP FILE 

DO I/O TO INDTMP FILE (SET NEW CSW ADDRESS) 



TSEM2 
EMTTRC 



TSX-Plus EMT Overlay 
-- Trace EMT execution 



1 



MACRO VQ5. 05 Wednesday 18~Jan~89 10: 37 Page 58 



SBTTL EMTTRC — Trace EMT execution 



3 








EMTTRC is 


ca 


lied from TSEMT when each EMT is processed 


and the 




4 








EMT TRACE 


mo 


de is turned on. 


The EMT information has been 




5 
6 
7 014010 








set up in 


EMTBLK. 








010246 


1 


EMTTRC: MOV 




R2, -<SP) 








8 014012 


010346 






MOV 




R3, -<SP> 








9 014014 


010446 






MOV 




R4, -(SP) 








10 014016 

11 

12 

13 

14 014020 


010546 






MOV 




R5, -<SP) 














Determine 


if 


we should trace 


this EMT 






032761 


OOOOOOG OOOOOOG 




BIT 




#*INKMN, LSW4<R1) 


•> IS KMON RUNNING? 






15 014026 


001101 






BNE 




9* 


>BR IF YES — DON'T TRACE 


KMON 




16 014030 


032761 


OOOOOOG OOOOOOG 




BIT 




#*CCLRN,LSW5<R1) 


; IS CCL RUNNING? 






17 014036 


001075 






BNE 




9* 


; BR IF YES — DON'T TRACE 


CCL 




18 014040 


032737 


OOOOOOG OOOOOOG 




BIT 




#UMODE, EMTPS 


; WAS EMT EXECUTED IN USER 


MODE? 




19 014046 

20 

21 


001471 






BEQ 




9* 


i BR IF NOT — DON'T TRACE 


KERNEL EMT 


'S 








We want tc 


t 


race this EMT 








22 
23 
24 014050 








Begin disp 


la 


y 1 ine 








012700 


000015 




MOV 




#15, RO 


; PRINT CR 






25 014054 








. TTYOUT 










26 014060 


012700 


000012 




MOV 




#12, RO 


; PRINT LF 






27 014064 








. TTYOUT 










28 






Print EMT a 


dd 


ress 








29 014070 


013705 


OOOOOOG 




MOV 




EMTADR, R5 


; GET EMT ADDRESS 






30 014074 


012703 


000005 




MOV 




#5, R3 


; PRINT 16-BIT VALUE 






31 014100 


004737 


014244' 




CALL 




PRTOCT 








32 








Print EMT 


instruction lour-ord 


er byte 






33 014104 


113705 


OOOOOOG 




MOVB 




CUREMT, R5 


; GET INSTRUCTION ARGUMENT 


BYTE 




34 014110 


012703 


000003 




MOV 




#3, R3 


; PRINT 8-BITS 






35 014114 


004737 


014244' 




CALL 




PRTOCT 


; PRINT IT 






36 








Print func 


tion code 








37 014120 


113705 


00000 1G 




MOVB 




EMTBLK+1,R5 


; GET FUNCTION CODE 






38 014124 


123727 


OOOOOOG 000374 




CMPB 




CUREMT, #374 


; IS THIS AN EMT 374? 






39 014132 


001003 






BNE 




3* 


; BR IF NOT 






40 014134 


162705 


000046 




SUB 




#E375MX, R5 


; GET 374 FUNCTION CODE 






41 014140 


000405 






BR 




2* 


; GO PRINT IT 






42 014142 


020527 


000062 


3* 


CMP 




R5, #RT11EX 


; IS THIS A TSX EMT? 






43 014146 


103402 






BLO 




2* 


i BR IF NOT 






44 014150 


062705 


000016 




ADD 




#<100-RT11EX>, R5;GET ORIGINAL FUNCTION CODE VALUE 




45 014154 


004737 


014244' 


3* 


CALL 




PRTOCT 








46 








Print channe 


1 number 








47 014160 


113705 


OOOOOOG 




MOVB 




EMTBLK, R5 


; GET CHANNEL # 






48 014164 


004737 


014244' 




CALL 




PRTOCT 


; PRINT IT 






49 








Print EMT 


ar 


gument values 








50 014170 


012704 


000002G 




MOV 




#EMTBLK+2, R4 


j POINT TO ARGUMENT BLOCK 






51 014174 


012702 


000005 




MOV 




#5, R2 


; PRINT 5 ARGUMENT VALUES 






52 014200 


010203 






MOV 




R2, R3 


j PRINT 16-BITS EACH 






53 014202 


012405 




1* 


MOV 




(R4)+, R5 


; GET ARGUMENT VALUE 






54 014204 


004737 


014244' 




CALL 




PRTOCT 


i PRINT IT 






55 014210 


077204 






SOB 




R2, 1* 


;LOOP IF MORE TO PRINT 






56 








End of line 










57 014212 


012700 


000015 




MOV 




#15, RO 


; PRINT CR 







< 
I 
I 
( 
i 
t 
1 
< 
< 

< 

< 
< 
i 



TSEM2 
EMTTRC 



TSX-Plus EMT Overlay 
— Trace EMT execution 



MACRO V05. 05 Wednesday 18-Jan-89 10: 37 Page 58-i 



58 014216 

59 014222 

60 014226 
61 

62 
63 

64 014232 

65 014234 

66 014236 

67 014240 

68 014242 



012700 000012 



. TTYOUT 

MOV 

. TTYOUT 



#12, RO 



i PRINT LF 



Finished 



012605 
012604 
012603 
012602 
000207 



9*: 



MOV 
MOV 
MOV 
MOV 
RETURN 



(SP)+, R5 
<SP>+, R4 
<SP)+, R3 
<SP>+, R2 



TSEM2 TSX-Plus EMT Overlay 
PRTOCT — Print an octal value 



MACRO V05. 05 Wednesday 18-Jan-S9 10:37 Page 59 



1 








2 








3 








4 








5 








6 








7 








8 








9 


014244 


010346 




10 


014246 


010446 




11 


014250 


010546 




12 








13 








14 








15 


014252 


020327 


000005 


16 


014256 


001007 




17 


014260 


012700 


000030 


18 


014264 


006105 




19 


014266 


006100 




20 


014270 






21 


014274 


000404 




22 








23 








24 








25 


014276 


042705 


177400 


26 


014302 


072527 


000007 


27 








28 








29 








30 


014306 


012704 


000006 


31 


014312 


073427 


000003 


32 


014316 


010400 




33 


014320 






34 


014324 


077310 




35 








36 








37 








38 


014326 


112700 


000040 


39 


014332 






40 


014336 






41 








42 








43 








44 


014342 


012605 




45 


014344 


012604 




46 


014346 


012603 




47 


014350 


000207 




48 




000001 




Errors c 


etected 








. SBTTL PRTOCT — Print an octal value 

PRTOCT is called to print an octal value on the user's terminal. 

Inputs: 
R5 = Value to be printed. 
R3 = 8/16-bit flag: 3=~>B-bit value, 5==>16-bit value 



PRTOCT: MOV 
MOV 

MOV 



R3, -<SP) 
R4, -<SP> 
R5, -<SP> 



If this is a 16-bit value, print 1st digit now 



IS THIS A 16-BIT VALUE? 

BR IF NOT 

GET 60 SHIFTED 

GET 1ST BIT OF VALUE 

INTO RO 

PRINT IT 



This is an 8-bit value, left justify the 8 bit quantity 



CMP 


R3, #5 


BNE 


1* 


MOV 


#30, RO 


ROL 


R5 


ROL 


RO 


. TTYOUT 




BR 


2* 



1*: 



BIC #~C<377>, R5 
ASH #7, R5 



; CLEAR ALL BUT 8 BITS 
i LEFT JUSTIFY THE VALUE 



?*: 



Begin loop to print the value 

MOV #6, R4 
ASHC #3, R4 
MOV R4, RO 
. TTYOUT 
SOB R3, 2* 



WILL BECOME 60 WHEN SHIFTED 

MOVE 3 BITS FROM R5 TO R4 

GET TO RO FOR TTYOUT 

SEND THE CHARACTER 

LOOP IF MORE DIGITS TO PRINT 



Put in 2 spaces following value 



MOVB 


#' ,R0 


. TTYOUT 




. TTYOUT 




Fini shed 




MOV 


(SP)+, R5 


MOV 


(SP)+, R4 


MOV 


<SP)+, R3 


RETURN 




. END 





GET SPACE 
SEND IT 



#** Assembler statistics 



Work file reads: 

Work file writes: 

Size of work file: 9458 Words ( 37 Pages) 

Size of core pool: 18176 Words < 71 Pages) 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 59-1 
PRTOCT — Print an octal value 

Operating system: RT-11 

Elapsed time: 00:01:11.49 
, LP: TSEM2=DK: TSEM2/C/N: SYM 



< 

i 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-S9 10:37 Page S-l 
Cross reference table <CREF V05. 05) 



*CCLRN 


1-103 


58-16 






















*CFOPN 


1-84 


14-21 






















*CTRLO 


1-107 


1-127 


14-24 




















*CTRLS 


1-85 


44-67 






















SDBGMD 


1-120 


41-67 


41-70 




















*DEAD 


1-128 


44-26 






















$DETCH 


1-86 


32-34 






















*DILUP 


1-152 


32-32 






















*EMTTR 


1-92 


4-14 






















*FORM 


1-119 


1-163 






















SHARD 


1-128 


44-24 






















*INDDW 


1-123 


57-33 


57-37 




















*INDRN 


1-110 


8-75 


9-91 




















*INKMN 


1-104 


4-36 


32-38 


54-44 


58-14 
















SIOMAP 


1-164 


27-89 






















*KINIT 


1-167 


38-34 






















*MLOCK 


1-167 


38-67 






















*NOINT 


1-134 


42-9 


42-14 




















*ODTMD 


1-132 


41-66 


41-69 




















*PRGLK 


1-104 


48-11 


48-18 




















*TTGAG 


1-138 


32-36 






















*UDSPC 


1-160 


54-53 






















*V52EM 


1-160 


40-11 






















*VIRJB 


1-97 


12-90 






















*VNOTT 


1-85 


46-98 






















. . . VI 


15-40 


58*—k.5 


58-27 


58-58 


58-60 


59-20 


59-33 


59-39 


59-40 








. . . V2 


15-40 


1 5-40# 






















ABORT 


1-131 
























ABRTAD 


1-102 


37-20* 






















ABRTCD 


1-102 


37-21* 






















ABTIO 


1-88 


2-60 






















ADM3A 


1-161 


40-30 






















ALCEMT 


1-90 


2-112 






















ASTXIT 


3-18 


35-5# 






















BADEMT 


1-76 


2-19 


2-23 


2-29 


2-30 


2-39 


2-58 


4-25 


35-12 


37-16 






C. CSW 


1-144 


8-7 


8-16 


8-48 


8-53 


8-67 


8-69* 


8-148 


8-150* 


9-7 


9-16 


9-51 




9-63 


9-65* 


9-71 


9-73* 


9-128 


9-130* 


9-136 


9-138* 


11-7 


11-74 


11-76* 


11-79 




11-81* 


16-6 


16-9 


16-36 


16-38* 


17-9 


17-26 


17-51* 


18-6 


18-20 


18-27* 


19-9 




19-15 


20-9 


20-20 


20-22* 


26-9 


26-11 


26-23 


26-39 


26-46 


52-26 


52-135 




C. DEVQ 


1-146 


17-32 


26-36 


52-29 


















C. LENG 


1-147 


19-23 


26-29 


52-95 


















C. NUMQ 


1-145 


17-31* 






















C. SBLK 


1-147 


8-83 


8-108 


26-26 


52-93 


52-109 














C. USED 


1-144 


8-104 


8-112* 


8-113* 


19-25* 


26-32 














CANMKT 


1-74 


15-21 


24-56 


25-9# 


















CAPOPN 


2-87 


5-12# 






















CDFN 


2-21 


26-63# 






















CFACFL 


1-128 


27-29 






















CFLAG 


1-110 


8-121 






















CFPNT 


1-99 


27-27 






















CHKABT 


1-135 


22-14 


33-24 


51-21 


















CHKERR 


7-9 


7-18 


7-27# 




















CHKSF 


5-6 


5-12 


5-19 


5-26 


5-33 


5-39 


5-45 


5-53 


5-61# 








CHKTT 


8-42 


9-43 


50-13# 




















CHKUSP 


1-91 
























CHNADR 


1-126 


4-51* 


8-6 


9-6 


11-6 


16-5 


17-5 


17-25 


18-5 


19-5 


20-5 


26-5 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday iS-Jan-S9 10:37 Page S-2 
Cross reference table <CREF V05. 05) 





50-13 


52-23 


57-49* 












CHNERR 


4-40 


4-71# 














CHNNUM 


1-121 


4-42* 


18-9 


52-22 


57-25 








CHNSIZ 


1-11S 


4-49 














CHSTAT 


2-31 


26-5# 














CINDAT 


1-144 


14-10 


29-18 












CINFLG 


1-71 


14-5* 














CKINAC 


2-85 


41-77# 














CKIOST 


8-5 


9-5 


11-5 


51-8# 










CKWIN 


2-115 


5-75# 














CLEMT 


1-84 


2-111 














CLKOPN 


2-66 


5-6# 














CLOSE 


1-122 


2-15 


2-55 


18-26 


19-28 








CLOSZ 


2-45 


19-5# 














CLRDIR 


1-108 


8-91 














CLZERR 


1-122 


4-57* 


18-31 


19-17* 


19-27* 








CMDB 


1-176 


31-5 














CMDC 


1-176 


31-6 














CMDE 


1-176 


31-3 














CMDF 


1-176 


31-9 














CMDG 


1-176 


31-10 














CMDH 


1-176 


31-11 














CMDI 


1-177 


31-12 














CMDJ 


1-177 


31-13 














CMDK 


1-177 


31-14 














CMDL 


1-177 


31-15 














CMDM 


1-177 


31-16 














CMDN 


1-177 


31-17 














CMDO 


1-177 


31-18 














CMDR 


1-178 


31-21 














CMOS 


1-178 


31-22 














CMDT 


1-178 


31-23 














CMDU 


1-178 


31-24 














CMDW 


1-178 


31-26 














CMDX 


1-178 


31-27 














CMDY 


1-178 


31-28 














CMDZ 


1-178 


31-29 














CMKT 


2-27 


24-5# 














CONFIG 


1-165 


12-29 














CORUSR 


1-127 


4-13 


23-14 


25-15 


49-36 


51-13 


52-30 


54-34 


CP*STD 


1-119 


49-40 














CPYEMT 


1-90 


2-114 














CQ*CP 


1-119 


49-40* 














CQ*FLG 


1-109 


24-17 


25-17 












CQ*HOT 


1-157 


23-20* 


24-35 












CQ*JOB 


1-99 


23-14* 


24-15 


25-15 


49-37* 








CQ*LNK 


1-99 


23-36* 


24-11 


24-13 


24-26 


24-26* 


25-11 


25-13 


CQ*LOT 


1-157 


23-22* 


24-37 












CG*PA5 


1-99 


23-29* 


49-45* 












CQ*PRI 


1-130 


49-39* 














CQSRO 


1-99 


23-31* 


24-19 












CQ*RNS 


1-130 


49-38* 














CQ*RTN 


1-99 


23-27* 


49-23 


49-44* 










CS*ENT 


1-142 


8-106 


16-9 


17-29 


19-15 








CS*EOF 


1-143 


9-71 


9-73 


9-136 


9-138 


11-79 


11-81 


52-88 


CS*ERR 


1-142 


8-67 


8-69 


8-148 


8-150 


9-63 


9-65 


9-128 



25-19 25-19* 



52-90 52-92 

9-130 11-74 11-76 20-20 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 
Cross reference table (CREF V05. 05) 



18-21 
11-8 



Wednesday 18-Jan-89 10:37 Page S-3 





20-22 








CS*NMX 


1-142 


1-143 


17- 


-34 


CS*OPN 


1-143 
26-46 


8-7 


9 


-7 


CS*RON 


1-110 


8-54 






CS*SPL 


1-149 


8-48 






CSFACT 


2-83 


5-45# 






CSIARE 


1-148 


1-174 






CSIGEN 


1-91 


3-8 






CSISPC 


1-91 


3-9 






CUNLK 


2-67 


5-19# 






CURCP 


1-127 


36-7 


51- 


-11 


CUREMT 


1-107 


58-33 


58- 


-38 


CVTUAD 


52-71 


54-32# 






CW*FPU 


1-132 


12-29 






CXTBAS 


1-113 


54-46 


54- 


-77 


CXTBUF 


1-85 


38-79 






CXTRMN 


1-128 


4-43 


21- 


-19 


DATE 


2-59 


21-17# 






DCRD1 


1-111 


9-84 






DCRD2 


1-112 


9-118 






DELETE 


1-87 


2-8 






DETEMT 


1-78 


2-92 






DH**LB 


1-107 


8-87 






DIABLO 


1-162 


40-33 






DIEARG 


1-42 








DIEMSG 


1-42 








DISMNT 


1-89 


2-95 






DOC IN 


2-57 


14-5# 






DOCOPN 


1-92 


5-7 






DOCULK 


1-92 


5-20 






DOEMT 


1-70 


4-13# 






DOGVAL 


27-17# 


28-55 






DOOPAP 


1-92 


5-13 






DORLK 


1-92 


5-27 






DOSFCK 


1-93 


5-46 






DOTLK 


1-93 


5-34 






D0ULK1 


1-93 


5-40 






DOWAIT 


2-18 


2-49 


20- 


-5# 


DSSDIR 


1-110 


8-85 


8- 


-110 


DS*NRD 


1-143 


18-22 






DS*RON 


1-110 


8-59 






DS*SFN 


1-97 


11-16 






DS*WON 


1-111 


9-55 






DSTAT 


1-90 


3-6 






DVFLAG 


1-109 


8-18 


9- 


18 


DVSTAT 


1-136 


8-59 


8- 


-85 


DX*EBA 


1-109 


8-18 


9- 


-18 


E374MX 


2-6 1# 








E375MX 


1-69 


2-46# 


58- 


-40 


ECO 


1-186# 








ECl 
EC2 


1-187# 
1-188# 


19-27 
19-17 






EC 3 


1-189# 








EC4 


1-190# 








EMT 16 


2-22 


4-64# 







i 
c 



26-11 
16-6 



16-36 



17-9 



17-27 



18-6 



19-9 



20-9 



26-9 



27-30 



28-8 



?8~2£ 



28-39 



57-47 



11-30 



-85 



8-110 



9-55 



11-16 



1 1 -30 



18- 



-85 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18~Jan-89 10:37 Page 3-4 
Cross reference table <CREF V05. 05) 



EMT374 
EMT376 
EMTADR 
EMT ASP 
EMTBLK 



EMTCAD 

EMTCAS 

EMTERR 

EMTLST 

EMTMAP 

EMTMAX 

EMTPLS 

EMTPLX 

EMTPS 

EMTRAD 

EMTSP 

EMTSPD 

EMTTRC 

EMTWIN 

EMTXIT 



EMUNAM 

ENTER 

ESPCPS 

EXCJOB 

EXIT 

FAKCMP 

FETCH 

FPUUSE 

FRECXT 

GETBRK 

GETCXT 

GETDSS 

GETPPN 

GETQ 

GETTIM 

GETUCH 

GFINFO 

GTJB 

GTJJ 

GTLICN 

GTMSBF 

GTSPAC 

GVAL 



2-49# 

1-69 

1-105 

1-91 

1-103 

8-125 

11-55 

21-34 

30-17 

38-41 

44-53 

49-50 

55-45* 
1-126 
1-127 
1-141 
2-8# 
1-121 
2-119# 
1-93 
2-38 
1-103 
1-126 
1-91 
2-110 
4-18 
1-93 
1-75 
9-39 

15-47 

26-51 

38-139 

46-101 
2-105 
1-87 
2-41 
1-107 
3-12 
1-111 
1-90 
1-132 
1-84 
2-93 
1-85 
1-180 
2-100 
1-71 
2-25 
1-72 
1-89 
2-24 

13-23# 
1-84 

32-47 
1-176 
2-36 



2-61 

37-8# 

37-10 

1-91 

4-22 

8-142 

11-65 

22-5 

30-23 

40-44 

44-61 

52-54 

56-25 

35-9 

35-10 

2-46 
23-29 
4-23 
6-8 
6-6# 
4-34 
35-13* 

44-1 1# 
58-7# 

5-79 

2-33 

9-145 
16-39 
26-64 
38-155 
47-59 
47-8# 

2-10 
36~7# 
12-75 
29-5# 

8-37 

3-7 
12-31* 
38-82 
49-6# 
38-72 
44-51 
40-44# 

8-95 
21-5# 
32-61 

2-103 
13-5# 

41-90 
33-9# 
31-7 
27-5# 



58-29 

4-32 

12-6 

23-16 

32-22* 

41-8 

46-14 

52-56 

57-27 

35-14* 



2-62 
49-45 



8-89 



2-35 
10-7 
17-46 
27-32 
38-167 
48-12 



8-170 
12-33* 



9-97 



4-64 
9-14 
12-15 
23-24 
32-26 
41-20 
46-23 
52-58 
57-35 



2-119 
53-18 



8-121* 



2-44 
10-15 
18-37 
27-45 
40-23 
48-19 



9-38 



11-41 



7-7 


7-16 


9-26 


9-36 


12-24 


12-42 


23-31 


24-6 


32-40 


32-54 


41-46 


41-64 


46-24 


47-9 


52-63 


52-70 


57-46* 


58-37 



4-59 
54-95 



5.1-9 



2-56 
11-18 
19-11 
28-11 
40-50 
49-55 



23-9 



52-59 



3-10 
11-87 
20-28 
28-24 
41-59 



49-35 



7-25 
9-86 
12-72 
24-31 
32-70 
42-4 
47-11 
52-78 
58-47 



54-38 



3-11 
12-18 
21-21 
28-42 
41-80 



8-14 


8-25 


8-35 


8-87 


8-119 


9-101 


9-122 


11-22 


11-26* 


11-46 


13-5 


16-27 


17-16 


19-22 


21-5 


26-17 


26-63 


27-5 


27-11 


27-12 


33-12 


33-16 


36-15 


38-15 


38-24 


43-9 


43-22 


44-15 


44-35 


44-45 


47-16 


48-6 


49-11 


49-30 


49-41 


52-82 


52-102 


52-105 


52-108 


55-35 


58-50 











58-18 



5-55 
12-43 
21-53 
30-27 
42-19 



7-27 
12-61 
22-26 
32-76 
43-32 



8-38 
12-94 
23-42 
35-15 
44-73 



8-156 


8-174 


13-23 


14-25 


24-46 


24-57 


36-18 


38-106 


45-25 


46-77 



33-25 



TSEM2 TSX-Plus EMT Overlay MACRO VG5. 05 Wednesday 18-Jan-89 10:37 Page S-5 
Cross reference table (CREF V05. 05) 



GVBAD 


28-5 


28-7 


28-16 


28-27 


28- 


-33 


28-45 


28-50# 


GVJMP 


27-13 


28-55# 














HAZEL 


1-161 


40-29 














HERR 


2-54 


10-12# 














HITRM 


40-16 


40-37# 














HRESET 


3-19 


15-6# 














INDDBL 


1-123 


57-27 














INDDBS 


1-123 


57-45 














INDFIL 


1-179 


43-40 














INDIO 


8-77 


9-93 


57-2 1# 












INTEMT 


2-109 


42-4# 














INTERR 


1-111 


9-104* 


9-151 


52-123* 


52- 


-128* 






INTPRI 


1-100 


23-38 


24-27 


24-50 


25- 


-20 


25-28 


33-31 


IOABFL 


1-129 


18-24 














IOABRT 


8-160 


9-100 


9-105 


9-1 50# 


11- 


-91 






IOHALT 


1-105 


15-6 














IOWAIT 


1-74 


8-144 


9-124 


1 1 -70 


16- 


-16 


18-8 


20-16 


JBINFO 


2-102 


38-1 5# 














JCDB 


1-128 


8-136 


9-80 


9-114 


16- 


-20 


17-40 


18-13 


JIBASE 


38-116# 


38-175 














JICONT 


38-1 10# 


38-174 














JICPU 


38-133# 


38-178 














JIDLN 


1-166 


38-65 














JIJMPX 


38-53 


38-171# 


38-182 












J I MEM 


38-102# 


38-173 














JIMLOK 


1-166 


38-69 














J I NAME 


38-148# 


38-180 














JIPAPR 


3S-159# 


38-181 














JIPPN 


38-127# 


38-177 














JIPRIO 


38-143# 


38-179 














JIPRIV 


1-166 


38-81 














JIPROG 


38-121# 


38-176 














JIRET1 


38-84 


38-96 


38-98 


38-104# 


38- 


-112 


38-117 


38-144 


JIRET2 


38—1 23 


38-129 


38-135# 












JIRNND 


38-93 


39-31# 














JIRNST 


38-88 


39- 5# 














JIRUN 


38-88# 


38-172 














J I STAT 


38-57# 


38-171 














JIVLN 


1-166 


38-63 














JNOP 


12-9 


12-18# 


12-34 












JSWLOC 


1-137 


12-89* 














KMNBAS 


1-113 


54-48 














KMNEMT 


1-77 


2-88 














KPAR6 


1-86 


52-25 














LAI 20 


1-161 


40-32 














LA36 


1-161 


40-31 














L ACT IV 


1-100 


41-77 














LBASE 


1-149 


38-116 


54-82 












LBRKCH 


1-129 


49-19* 


49-51* 












LBRKCQ 


1-129 


49-21 


49-24* 


49-46* 










LBSPRI 


1-130 


46-94 


46-96* 












LCONTM 


1-153 


38-111 


46-110 












LCPUHI 


1-168 


38-133 














LCPULO 


1-168 


38-134 














LDSRON 


1-98 


56-36 














LDBASE 


1-98 


55-61 


56-51 













34-25 



51- 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page S-6 
Cross reference table <CREF V05. 05) 



LDDEVX 


1-113 


11-34 


52-114 












LDFLAG 


1-98 


56-36 














LDIO 


52-117 


55-13# 














LDMEMT 


1-85 


2-117 














LDNAME 


1-105 


56-67 














LDPDEV 


1-98 


55-21 


56-33 












LDRST 


55-40 


56-19# 














LDSIZE 


1-98 


55-44 


55-56 


56-59 










LDVERS 


1-98 


56-26 


56-38 












LEMTPC 


1-160 


29-5* 














LIOCNT 


1-133 


51-17 














LIOHLD 


1-133 


51-14 


51-23* 












LITIME 


1-134 


42-15* 














LJSW 


1-121 


12-87* 


12-88 


15-38 


29-9 








LMSGBF 


1-140 


34-15 


34-23* 












LNBLKS 


1-167 


38-102 














LNMAP 


1-140 


34-29 














LNPRIM 


1-140 


27-136 


27-165 


34-14 


38-159 


40- 


-10 


41-19 


LNSBLK 


1-165 


38-103 














LOOKUP 


1-87 


2-9 














LOTRM 


40-8 


40-20 


40-27# 












LPARBS 


1-115 


54-64 


54-107 












LPARNT 


1-106 


27-145 


38-161 












LPRG1 


1-168 


38-121 


47-41 


47-53* 










LPRG2 


1-168 


38-122 


47-43 


47-58* 










LPRI 


1-130 


27-111 


38-143 


46-97* 


49-39 








LPROG 


1-105 


27-101 


38-128 


40-48 


46-118 








LPROJ 


1-105 


27-96 


38-127 


40-46 


46-117 








LSCCA 


1-132 


12-5 


12-8* 












LSECPT 


1-140 


27-166 


41-28 












LSLEPH 


1-124 


22-8* 


22-15 












LSLEPL 


1-124 


22-10* 


22-18 












LSPND 


1-125 


15-17* 














LST16 


3-4# 


4-66 














LSTATE 


1-141 


38-89 














LSTDL 


1-158 


27-163 


38-61 


41-15 










LSTHL 


1-116 


1-121 


44-22 












LSTPL 


1-152 


38-59 


41-13 












LSTSL 


1-167 


32-30 


38-27 


44-19 










LSW 


1-107 


32-32 


32-34 


38-34 


46-98 


46- 


-111 




LSW11 


1-160 


40-11 


54-53 












LSW2 


1-103 


46-112 














LSW2S 


1-133 


46-119 














LSW3 


1-124 


1-126 


14-24* 


44-24 


44-26 


44- 


-67* 


46-113 


LSW4 


1-104 


4-36 


14-21 


32-38 


41-66* 


41- 


-69* 


46-114 


LSW 5 


1-104 


8-75 


9-91 


46-115 


48-11* 


48- 


-18* 


58-16 


LSW6 


1-120 


4-14 


27-89 


38-67 


41-67* 


41- 


-70* 


57-33 


LSW7 


1-154 


32-36 


42-9* 


42-14* 










LSW9 


1-153 


12-90* 


46-116 












LTRMTP 


1-162 


40-9 














LUNAME 


1-106 


38-151 


47-15 












MAXCC 


1-173 


30-20 














MAXGVL 


1-102 


27-21 


28-6 


28-19 


28-36 








MAXLD 


1-105 


56-30 


56-46 


56-52 


56-60 


56- 


-68 




MAXPRI 


1-134 


46-90 














MAX SEC 


1-140 


27-170 


41-24 













44-21 



54-44 58-14 
57-37* 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan~89 10:37 Page 5-7 
Cross reference table (CREF V05. 05) 

MINTIM 1-167 38-110 

MONABT 1-101 15-25 

MONEMT 1-90 2-113 

MOUNT 1 -89 2-94 

MRKT 2-26 23-5# 

MRKTHD 1-157 23-36 23-37* 24-11 25-11 

MSfDTR 1-180 44-52 44-55 

MSEND 1-94 7-8 

MSGABT 1-101 15-31 

MSGCK 1-94 7-17 

MSGPRV 7-6 7-15 7-24 7-33# 

MSGWT 1-94 7-26 

MXJADR 1-132 12-77 

MXJIFN 38-16 38-182# 

MXJPRI 1-130 27-116 46-93* 

MXNGTX 46-43 46-127# 

MXPSTX 46-50 46-120# 

MXSPTF 46-31 46-106# 

MXSYFN 43-10 43-4 1# 

MXTSXV 27-37 27-67# 

NEGTAB 46-45 46-124# 46-127 

NFRESB 1-100 41-51 41-58 

NLCHN 1-92 4-33 

NMUMB 1-139 33-10 33-29* 

NSPLBL 1-100 41-50 

NSPLDV 1-135 18-10 41-48 41-87 

NUCHN 1-102 4-38 15-35 

NUMDCD 1-111 9-82 9-116 

NUMDEV 1-156 17-35 

ODTBAS 1-108 12-54 12-56 12-92* 13-10 13-21 

OVLBIT 1-148 15-38 

OVRHC 1-182 7-8 7-17 7-26 8-91 8-164 15-25 15-31 18-12 30-25 38-72 38-78 

38-82 46-100 52-117 

P0*BYP 1-96 48-10 

POfDBG 1-92 4-16 

PO*MEM 1-133 28-26 28-44 

PO*NAM 1-95 47-22 48-10 

PO*OPR 1-95 21-27 32-20 

POSSND 1-96 32-16 

POSSPF 1-96 11-32 

PO*SPV 1-97 48-8 48-10 

PO*SYS 1-95 27-82 38-79 46-19 48-10 

P2SMSG 1-94 7-35 

P2*RLK 1-93 5-63 

P2*TRM 1-95 44-33 

PASLIN 1-125 29-9 

PEEK 28-15# 28-56 

PKGET 28-23# 28-28 

PKLOW 28-18 28-20 28-26# 

PMEMT 1-78 2-96 

PNAME 1-102 26-41 

POKE 28-32# 28-58 

POLOW 28-35 28-37 28-44# 

POSTAB 46-52 46-1 10# 46-120 

POVAL 28-40# 28-46 

PRINT 1-91 3-13 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page S-S 
Cross reference table (CREF V05. 05) 

PRIVCO 1-103 4-16 11-32 21-27 27-S2 28-26 28-44 32-16 32-20 38-76 46-19 47-22 

48-8 48-10* 

PRIVC2 1-96 5-63 7-35 44-33 

PRTOCT 58-31 58-35 58-45 58-48 58-54 59-9# 

PS l-24# 23-35* 23-38* 24-12* 24-27* 24-50* 25-12* 25-20* 25-28* 33-9* 33-31* 34-13* 

34-25* 51-16* 51-24* 

PURGE 2-52 18-5# 19-18 

PVAL 28-4# 28-57 

PVSPBL 1-108 41-52 

Q. BLKN 1-145 52-110* 55-55 55-61* 

Q. BUFF 1-112 52-72* 

Q.CHAN 1-112 52-22* 

Q. COMP 1-113 53-17* 

Q. CSW 1-112 52-44* 

Q. DEVX 1-98 52-28* 52-114 55-23* 55-32* 

Q. FUNC 1-145 11-46* 55-30 

Q. ICSW 1-118 8-113* 52-43 52-135* 

Q. JNUM 1-112 52-37* 

Q. JOB 1-112 52-32* 

Q. PAS 1-113 53-18* 

Q. PA6 1-86 52-25* 

Q. PAR 1-113 52-73* 

Q. UCSW 1-118 52-24* 

Q. UNIT 1-146 52-29* 55-18 55-24* 55-26* 

Q. WCNT 1-144 8-102 8-114* 52-107* 55-51 

QF*IOT 1-109 24-17 25-17 

QFREE 1-73 9-150 23-46 24-42 25-21 49-26 49-59 

QHDSPN 1-156 22-21 

QIO 1-72 8-132 9-110 11-61 

GMSG 1-80 32-72 34 ~9# 

QNSPND 1-139 33-23 51-20 

QSET 3-15 12-42# 

QUME 1-162 40-34 

R*CFST 1-128 27-26* 27-29* 

R*CHN 1-118 1-159 4-44 4-48 13-14 

R*DATE 1-159 21-20* 

R*INTC 1-123 57-48 

R*XCHN 1-118 4-48 

RC*BAS 1-175 

RCTOCF 14-22# 

RCTRLO 3-17 14-21 # 

RDAR 1-108 54-61 

RDDR 1-108 54-59 

READ 1-70 2-16 9-5# 

REDCXT 1-85 38-78 

RENAME 1-87 2-12 

REOPEN 2-14 17-5# 

REQPRV 2-91 48-6# 

RFSWRT 1-120 

RLOCK 2-68 5-26# 

RMNBAS 1-150 13-14 28-17 28-19 28-21 28-34 28-36 28-38 

RPAR 1-108 54-57 

RPDR 1-108 54-55 

RSFBLK 1-179 43-38 

RSSPAC 1-177 31-19 

RT11EX 1-69 2-62# 4-29 58-42 58-44 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page 5-9 
Cross reference table <CREF V05. 05) 

RTDEV 1-87 2-20 

RTEMT 1-89 2-98 

RTRSUM 1-88 2-51 

RTSPND 1-88 2-50 

RUNDEV 1-86 45-17 

S*CPU 1-171 39-8 

S*HICP 1-115 39-28 

S*INWT 1-169 39-10 

S*IOFN 1-154 39-7 

S*IOWT 1-141 39-17 51-19 

S*LOW 1-115 39-9 

S*MSWT 1-169 39-15 

SSNEDQ 1-136 39-18 

S*OTFN 1-154 39-27 

S*OTLO 1-114 39-6 

S*OTWT 1-169 39- H 

S*QCCB 1-114 39-20 

S*QMIO 1-114 39-19 

S*QSPD 1-114 39-21 

S*GUSR 1-170 39-16 

S*RT 1-115 39-29 

S*SFWT 1-169 1-170 39-14 

S*SPCB 1-170 39-24 

S*SPDB 1-170 39-23 

SSSPND 1-169 39-13 

S*TMWT 1-155 22-20 39-12 

S*TTFN 1-115 39-26 

S*TTSC 1-114 39-25 

S*TWFN 1-114 39-5 49-38 

S*WFM 1-115 39-30 

SSWSMB 1-151 33-22 39-22 

SB*END 1-138 32-60 

SB*LNK 1-139 33-30 34-17 34-19 34-21* 34-24* 

SBSPNT 1-139 33-34* 

SB*TXT 1-138 32-58 33-33 

SCC A 2-37 12-5# 

SCHAIN 1-125 29-9 

SCHED 1-117 51-25 

SDCLOS 1-71 18-12 

SDMOVE 1-111 8-164 

SDTTM 2-40 21-27# 

SERFLG 1-106 10-4 10-6* 10-12 10-14* 

SERR 2-53 10-4# 

SETC 1-172 41-79 41-89 

SETCR 8-126 9-102 11-56 53-1 3# 

SETDSS 1-180 44-56 

SETERR 1-75 4-72 5-70 5-78 6-14 7-42 8-10 8-21 8-29 8-57 8-63 8-71 

8-152 9-10 9-21 9-30 9-59 9-67 9-76 9-132 9-141 9-152 11-11 11-25 

11-37 11-78 11-83 16-12 16-41 17-12 17-53 18-33 20-12 20-24 21-30 23-48 

24-52 26-56 27-9 27-24 27-40 28-51 30-32 32-19 32-43 32-50 32-81 36-10 

36-14 38-19 38-30 38-37 41-34 43-13 44-29 44-40 46-22 46-82 47-25 47-62 

48-14 49-61 

SETMXP 46-88# 46-105 

SETPRI 1-89 2-106 

SETQ 8-100 9-99 11-50 52-16# 

SETRBF 1-176 31-4 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 
Cross reference table <CREF V05. 05) 



Wednesday 18-Jan-89 10: 37 Page S-10 



SETS I Z 


2-99 


12-72# 








SETSPD 


1-101 


44-62 








SETTOP 


3-16 


12-49# 








SETTP1 


12~50# 


12-74 


12- 


-76 




SFCB 


1-100 










SFCBND 


1-100 










SFCLS 


1-144 


18-15 








SFDATE 


1-87 


2-42 








SFPA 


2-32 


12-24# 








SFPROT 


1-87 


2-43 








SFRSST 


1-149 


17-42 








SFSPND 


2-84 


5-53# 








SFSVST 


1-138 


5-54 


16- 


-22 




SFTIME 


1-89 


2-104 








SFWAC 


1-177 


31-20 








SFWL 


1-178 


31-25 








SFWRIT 


1-110 


8-138 








SITINF 


2-86 


41-87# 








SNDMSG 


2-89 


32-16# 








SNMSHD 


1-139 


33-14 


33- 


-30«- 




SPCPS 


1-127 


36-11 


36- 


-17* 




SPFUN 


2-34 


11 ~5# 








SPLBLK 


1-179 


43-37 








SPLEMT 


1-73 


2-107 








SPLTF 


46-33 


46-105# 


46- 


-106 




SPPRED 


1-85 


46-100 








SRESET 


3-14 


15-7 


15- 


~13# 




SSEMT 


1-79 


2-101 








STOP 


1-107 


14-15 


29- 


-29 


37-22 


STTCPL 


1-86 


49-13 








SUTOP 


1-137 


12-93 








SVSTAT 


2-13 


16-5# 








SWDBLK 


1-179 


43-36 








SYFEMT 


2-118 


43-9# 








SYFTBL 


43-18 


43-36# 


43- 


-41 




SYNAME 


1-129 


27-151 








SYSDAT 


1-101 


21-17 


21- 


-20 


21-40* 


SYSHLT 


1-42 










SYTIMH 


1-101 


21-7 


21- 


-47 * 




SYTIML 


1-101 


21-9 


21- 


-49* 




TBLEMT 


2-90 


46-14# 








TGCPRI 


27-57 


27-lll# 








TGIOMP 


27-53 


27-89# 








TGJOBN 


27-50 


27-7 1# 








TOLD IN 


27-51 


27-77# 








TGLICN 


27-56 


27-106# 








TGMPRI 


27-58 


27-1 16# 








TGPRHI 


27-63 


27-126* 








TGPRIL 


27-60 


27-136# 








TGPRIV 


27-52 


27-82# 








TGPRLO 


27-62 


27-121# 








TGPRNT 


27-64 


27-145# 








TGPROG 


27-55 


27-101# 








TGPROJ 


27-54 


27-96# 








TGRSUB 


27-66 


27-161# 








TGSYNM 


27-61 


27-151# 









38-74 



I 
I 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jar>-89 10:37 Page S-ll 
Cross reference table <CREF V05. 05) 



TGUCLB 


27-59 


27-131# 






























TGVERS 


27-65 


27-156# 






























TIMWAT 


2-28 


22-5# 






























TRMEMT 


2-97 


40-8# 






























TRNSTR 


1-140 


34-30 


44-68 




























TRPSET 


2-11 


12-15# 






























TRYLK 


2-69 


5-33# 






























TSEM2 


l-23# 


1-70 


14-22 




























TSXEMT 


2-66# 
































TSXGVC 


27-42 


27-49# 


27-67 




























TSXGVL 


27-20 


27-36# 






























TSXSIT 


1-97 


27-106 






























TSXVRS 


1-86 


27-156 






























TTEMT 


2-108 


30-17# 






























TTFUN 


30-24 


31-4# 






























TTOPTS 


1-137 
































TTREAD 


1-111 


9-45 






























TTYIN 


1-90 


3-4 






























TTYOUT 


1-90 


3-5 






























UACHKB 


1-112 


52-61 


52-68 




























UACHKW 


1-71 


23-17 


23-25 


24-33 


49-42 


53-15 






















UCHAN 


1-148 


15-46* 


26-63* 




























UCLBLK 


1-106 


27-131 






























UCLDAT 


1-179 


43-39 






























UFPTRP 


1-128 


12-26* 






























ULK1BK 


2-77 


5-39# 






























UMODE 


1-141 


4-34 


8-89 


51-9 


52-59 


54-38 


S3 


-18 


















UPDATE 


21-11 


21-19# 






























UPPN 


1-100 


46-125 


46-126 




























URO 


1-135 


6-13* 


8-34* 


8-61* 


8-119 


9-35* 


9- 


-57* 


9- 


-74* 


9- 


-86* 


9- 


-139* 


10-5* 


10-13* 




12-5* 


12-42* 


12-49 


12-58* 


12-82* 


21-17* 


26- 


-21* 


27- 


-31* 


27- 


-44* 


28- 


-9* 


28-23* 


28-40* 




40-22* 


41-31* 


41-39* 


41-56* 


41-58* 


45-24* 


46- 


-61* 


49- 


-20* 


49- 


-23* 


52- 


-77* 


52-106* 




UTRPAD 


1-106 


12-17* 






























VALADB 


1-104 


12-25 


3e£"~*»i?0 




























VALADW 


1-104 
40-45 


12-7 
43-24 


12-16 
47-10 


13-6 


16-28 


17-17 


21- 


-6 


21- 


-36 


22- 


-6 


26- 


-19 


36-16 


38-43 


VI MAGE 


1-97 


12-87 






























VLSEMT 


1-86 


2-116 






























VMAXMC 


1-101 


7-33 


15-29 




























VMXSF 


1-93 


5-61 






























VMXWIN 


1-93 


5-75 






























VPAR5 


1-115 


54-89 






























VPAR6 


1-100 


54-71 


54-108 


54-118 


























VPLAS 


1-99 


6-6 






























VPRIDF 


1-131 


46-92 






























VPRIHI 


1-131 


27-126 






























VPRILO 


1-131 


27-121 






























VSWPFL 


1-131 


12-73 






























VT100 


1-161 


40-28 






























VT2007 


1-162 


40-35 






























VT2008 


1-162 


40-36 






























VT52 


1-161 


40-13 


40-27 




























VTSLCH 


1-129 


27-77 


45-11 




























WRITE 


1-70 


2-17 


8~5# 




























WRITTT 


1-109 


8-44 






























WRTCPL 


8-168# 


9-87 































TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday 18-Jan-89 10:37 Page S-12 
Cross reference table (CREF V05. 05) 



WRTSPL 


8-49 


8-164# 


XGTLN 


2-74 


41-8# 


XGTTAB 


2-76 


45-8# 


XHIIN 


1-88 


2-79 


XHIOUT 


1-88 


2-78 


XHISET 


1-89 


2-82 


XJNOP 


41-32 


41-40 


XMSEND 


2-70 


7-6# 


XMSGCK 


2-71 


7-15# 


XMSGWT 


2-72 


7-24# 


XODTMD 


2-75 


41-64# 


XRDTIM 


1-88 


2-81 


XSPLSP 


2-73 


41-46# 


XTERCK 


1-88 


2-80 



41-57 41-59# 41-68 41-71 



4 

i 

4 



TSEM2 TSX-Plus EMT Overlay MACRO V05. 05 Wednesday lS-Jan~89 10' 37 Page M-j 

Cross reference table (CREF V05. 05) 

. . . CM3 15-40 

. . . CMS 58-25 58-27 58-58 58-60 59-20 59-33 59-39 59-40 

.PURGE l-65# 15-40 

. TTYOU l-65# 58-25 58-27 58-58 58-60 59-20 59-33 59-39 59-40 
DIE l-43# 

DISABL l-28# 23-35 24-12 25-12 33-9 34-13 51-16 

ENABL l-32# 23-38 24-27 24-50 25-20 25-28 33-31 34-25 51-24 

OCALL l-54# 7-8 7-17 7-26 8-91 8-164 15-25 15-31 18-12 38-72 38-78 38-82 

46-100 52-117