.nlist bin,loc,seq,sym .title TSX-Plus Macro Library .MACRO TSXCTX .rem % TSX-Plus Macro Library ====================== Release V01.02 for TSX-Plus V6.5 Copyright (c) 1987, 1988, 1989, 1990, 1991 by William K. Walker RDB/Alpha Systems and Software 740 Alpha Rd., Box 149 Alpha, OH 45301-0149 (513) 426-0344/426-7094 MCI Mail: 333-1675 Internet: rdbalpha@mcimail.com CompuServe: 71066,24 Internet: 71066.24@compuserve.com TSX-Plus is a product of S&H Computer Systems, Nashville, TN % .ENDM .sbttl Application Notes .rem % Notes on using this macro library: ---------------------------------- TSXMAC includes macros for every documented TSX-Plus EMT through V6.5. I have also included a handful of utility macros just because they're kind of handy. The level of documentation provided by the TSXMAC sources is similar to that found in the RT-11 Mini-Reference Manual: I have included the format of the macro call, a summary of its operation, a description of the arguments, the layout of the EMT argument block, and a precis of the documented error codes. Additional information on many of the TSX-Plus EMTs may be found in the TSX-Plus Programmer's Reference Manual. The best way to produce the TSXMAC documentation is to run this file through the MACRO assembler. See the TSXMAC build instructions at the end of this section. Macros whose titles are flagged with "*6.4*" or "*6.5*" are described in the TSX-Plus Release Notes. As such, they do not have "official" names yet. I have tried to make an educated guess at the names the TSX-Plus folks will assign to them when they include them in the regular documentation. Future updates will include the "correct" names as well. Macros other than those described solely in the release notes use the names listed in Appendix B.2 of the TSX-Plus Programmer's Reference Manual, with the following exceptions/extensions: o The "Abort Detached Job" request (ABRTDJ) will actually abort any job if the issuing job has enough privilege. Thus, I have also included a KILL macro. KILL is exactly the same as ABRTDJ, it just has a more appropriate name. o The TSX-Plus documentation describes a single SEND request (code 127, channels 0-3) which sends a message to a line in one of four different modes. I have broken this up into four separate calls: SEND, SENDW, YELL, and YELLW. o The TSX-Plus V6.5 Release Notes describes a single EMT with two channel values (code 147, channels 4 and 5) to get or set a terminal line name. I implemented this as two distinct requests: GTLNAM and STLNAM. o I have added a few "utility macros" that make life a little easier. These are: GVLDEF, which defines a set of offsets for use in obtaining TSX-Plus system values with the .GVAL request; PRVDEF, which defines a set of symbols for the TSX-Plus privilege flags; SETSIZ, which calculates and sets up the TSX-Plus initial program allocation size (i.e., does the same thing as the SETSIZ program); STTMSK, which can be used to form the speed/parity/character- length mask used in the STTSPD request; and TSXLIB, which can be used to generate FORTRAN-callable routines for TSX-Plus EMTs. The TSX-Plus documentation does not always thoroughly describe the EMT error codes. I have tried to be as complete as possible in this regard. In some cases -- the LDSTAT macro, for example -- I have derived the codes by experimentation. In general, if multiple codes are listed, they are probably accurate. If only a single code is listed, it is safest to translate that fact as meaning simply that if the carry bit is set on return, then the listed error occurred. To get a listing of this file, complete with a table of contents, run it through the MACRO assembler. For example, the command MAC/NOOB/LIST TSXMAC will produce a listing on the printer. I have set up the margins so that the listing will stay within 80 columns. To create the macro library, TSXMAC.MLB, use the following command: LIBR/MAC TSXMAC TSXMAC % .sbttl Edit History .rem % V01.00 20 Dec 89 Initial release; macros current through W. K. Walker TSX-Plus V6.4; 111 TSX-Plus requests, 3 utility macros, 4 core macros V01.01 21 Mar 90 Added GVLDEF and TSXLIB macros; 111 TSX-Plus W. K. Walker requests, 5 utility macros, 4 core macros Y01.02 03 Mar 91 Field test for V6.5; minor documentation W. K. Walker corrections; 7 new macros; 118 TSX-Plus requests, 5 utility macros, 4 core macros Y01.02a 04 Mar 91 Field test update; fixed SCTRLO macro W. K. Walker Y01.02b 02 Apr 91 Field test update; fixed places where W. K. Walker forced octal radix was omitted V01.02 03 Apr 91 Final release; includes minor doc and W. K. Walker distribution updates; 118 TSX-Plus requests, 5 utility macros, 4 core macros % .sbttl TSXMAC Macros Sorted Alphabetically .rem % Code Chan Name Description ---- ---- ---- ----------- 132 2 ABRTDJ Abort a detached job 111 0/1 ACTODT Reset/set ODT activation mode 156 0 ALCDEV Allocate a device for exclusive use 140 20 ATTSVC Attach interrupt service routine 140 11 ATTVEC Attach completion routine to interrupt vector 140 4 BICIO Bit-clear into the I/O page 140 3 BISIO Bit-set into the I/O page 123 0 CKACT Check for activation characters 116 0 CKTTIE Check for terminal input errors 121 CKWSHR Check for writes to shared file 143 3 CLRRTS Clear region definitions for fast map 133 0 DCLBRK Establish break sentinel control 156 1 DEALOC Deallocate a device from exclusive use 161 2 DELWIN Delete a process window 135 0 DISMNT Dismount a directory structure 135 5 DMTALD Dismount all logical disks 135 2 DMTFLS Dismount all mounted file structures 135 3 DMTLD Dismount a logical disk 145 FILINF Get file directory information 155 0 GETCL Assign CL unit to a line 160 0 GETCXT Acquire another job's file context 105 0 GETMSG Get message from named channel 140 23 GETPSW Get job's processor status word *6.5* 162 0 GISUBP Initiate or switch to a sub-process 162 2 GOSUBP Switch to a sub-process 150 1 GSJPRV Get/set job privileges 116 1 GTINCH Get number of pending input characters 147 4 GTLNAM Get terminal line name *6.5* 147 2 GTPNAM Get program name 147 0 GTUNAM Get user name GVLDEF Define TSX-Plus .GVAL offsets *Utility Macro* 136 3 HALTPA Terminate performance analysis 120 0/1 HIEFF Reset/set high-efficiency terminal mode 162 1 INISBP Initiate a sub-process 136 0 INITPA Initialize performance analysis 144 0 JSTAT Get job status information 132 2 KILL Abort a job 135 4 LDSTAT Get status of a logical disk 102 LOCKW Wait for locked block 140 13 LOKJOB Lock job in memory without re-positioning 140 7 LOKLOW Lock job in lowest memory 154 3 LTTDTR Lower DTR for a line 161 0 MAKWIN Create a refreshable process window 140 5 MAPIOP Map I/O page to user program 140 6 MAPMON Map simulated RMON to user program 140 17 MAPPHY Map to physical memory 143 1 MAPRTS Map run-time system into job 141 0 MEMTOP Set size of job 163 MNTLD Mount a logical disk 157 0 MONJOB Start monitoring job status Code Chan Name Description ---- ---- ---- ----------- 134 0 MOUNT Mount a file structure 106 1 MSGCPL Queue message receipt completion routine 157 1 NOMONJ Stop monitoring job status 153 0 NONINT Set [non]interactive job status 140 1 PEEKIO Peek into the I/O page 140 0 PHYADD Convert virtual to physical address, I-space 140 22 PHYDAD Convert virtual to physical address, D-space *6.4* 140 2 POKEIO Poke into the I/O page 161 5 PRTWIN Print window contents (via WINPRT) PRVDEF Define privilege flag symbols *Utility Macro* 143 6 REGGBL Set up a global PLAS region for fast mapping *6.4* 143 2 REGRTS Define shared run-time region for fast mapping 140 12 RELVEC Release interrupt vector 161 4 RSMWIN Resume window processing 154 2 RTTDTR Raise DTR for a line 140 15 RTURNS Relinquish exclusive system access 122 SAVSHR Save shared file status 140 21 SCHCMP Schedule completion routine 155 2 SCLRES Reset a CL line *6.4* 155 1 SCLXON Reset CL line XOFF status *6.4* 120 2 SCTRLO Suspend terminal output (emulate Control-O) *6.5* 127 2 SEND Send message to a line; no wait for buffer 127 0 SENDW Send message to a line; wait for buffer 152 0 SELOPT Set program controlled terminal options 161 1 SELWIN Select current process window 140 16 SETPRI Set user mode priority level SETSIZ Set program allocation space *Utility Macro* 117 0 SETTTO Set terminal read time-out 146 SFTIM Set file creation time 125 SHRFIL Declare file for shared access 143 5 SIDOFF Disable separate I- and D-space mapping *6.4* 143 4 SIDON Enable separate I- and D-space mapping *6.4* 143 7 SIDOVR Enable separate I- and D-space with overlays *6.5* 124 2 SITLCN Get site license number string *6.5* 124 1 SITNAM Get site name string *6.4* 124 0 SITNUM Get site license number *6.4* 150 0 SJBPRI Set job execution priority 104 0 SNDMSG Send message on named channel 151 SPFLAG Enable/disable spooler flag pages *6.4* 151 SPHOLD Set spooler HOLD/NOHOLD 107 0 SPLFRE Get number of free spool blocks 107 1 SPLUSE Get number of spool file blocks in use *6.4* 161 3 SPNWIN Suspend window processing 151 SPWIDE Set spooler flag page width *6.4* 157 2 STAMON Broadcast status to monitoring jobs 132 1 STATDJ Get detached job status 140 14 STEALS Get exclusive system access 147 5 STLNAM Set terminal line name *6.5* 136 2 STOPPA Stop monitoring performance 147 3 STPNAM Set program name 132 0 STRTDJ Start a detached job 136 1 STRTPA Start monitoring performance Code Chan Name Description ---- ---- ---- ----------- STTMSK Form speed, parity mask for STTSPD *Utility Macro* 154 0 STTSPD Set speed, parity for a time-sharing line 154 1 STTXON Reset line XOFF status 147 1 STUNAM Set user name 110 1 SUBPLN Get subprocess line number 103 TLOCK Try to lock a block 156 2 TSTALC Test device exclusive use allocation TSXLIB Build FORTRAN-callable routines *Utility Macro* 110 0 TSXLN Determine the TSX-Plus line number 115 0 TTIBLK Get block of text from terminal 133 1 TTICPL Set terminal input completion routine 114 0 TTOBLK Send block of text to terminal 137 0 TTYPE Get terminal type 101 UNLALL Unlock all blocks 113 UNLOCK Unlock a block 140 10 UNLOKJ Unlock job from memory 143 10 UPARC Enable user PAR control *6.5* 143 0 USERTS Associate with run-time system 106 0 WATMSG Wait for message on named channel 127 3 YELL Yell message to a line; no wait for buffer 127 1 YELLW Yell message to a line; wait for buffer % .sbttl TSXMAC Macros Sorted by Code and Channel .rem % Code Chan Name Description ---- ---- ---- ----------- GVLDEF Define TSX-Plus .GVAL offsets *Utility Macro* PRVDEF Define privilege flag symbols *Utility Macro* SETSIZ Set program allocation space *Utility Macro* STTMSK Form speed, parity mask for STTSPD *Utility Macro* TSXLIB Build FORTRAN-callable routines *Utility Macro* 101 UNLALL Unlock all blocks 102 LOCKW Wait for locked block 103 TLOCK Try to lock a block 104 0 SNDMSG Send message on named channel 105 0 GETMSG Get message from named channel 106 0 WATMSG Wait for message on named channel 106 1 MSGCPL Queue message receipt completion routine 107 0 SPLFRE Get number of free spool blocks 107 1 SPLUSE Get number of spool file blocks in use *6.4* 110 0 TSXLN Determine the TSX-Plus line number 110 1 SUBPLN Get subprocess line number 111 0/1 ACTODT Reset/set ODT activation mode 113 UNLOCK Unlock a block 114 0 TTOBLK Send block of text to terminal 115 0 TTIBLK Get block of text from terminal 116 0 CKTTIE Check for terminal input errors 116 1 GTINCH Get number of pending input characters 117 0 SETTTO Set terminal read time-out 120 0/1 HIEFF Reset/set high-efficiency terminal mode 120 2 SCTRLO Suspend terminal output (emulate Control-O) *6.5* 121 CKWSHR Check for writes to shared file 122 SAVSHR Save shared file status 123 0 CKACT Check for activation characters 124 0 SITNUM Get site license number *6.4* 124 1 SITNAM Get site name string *6.4* 124 2 SITLCN Get site license number string *6.5* 125 SHRFIL Declare file for shared access 127 0 SENDW Send message to a line; wait for buffer 127 1 YELLW Yell message to a line; wait for buffer 127 2 SEND Send message to a line; no wait for buffer 127 3 YELL Yell message to a line; no wait for buffer 132 0 STRTDJ Start a detached job 132 1 STATDJ Get detached job status 132 2 ABRTDJ Abort a detached job 132 2 KILL Abort a job 133 0 DCLBRK Establish break sentinel control 133 1 TTICPL Set terminal input completion routine 134 0 MOUNT Mount a file structure 135 0 DISMNT Dismount a directory structure 135 2 DMTFLS Dismount all mounted file structures 135 3 DMTLD Dismount a logical disk 135 4 LDSTAT Get status of a logical disk 135 5 DMTALD Dismount all logical disks Code Chan Name Description ---- ---- ---- ----------- 136 0 INITPA Initialize performance analysis 136 1 STRTPA Start monitoring performance 136 2 STOPPA Stop monitoring performance 136 3 HALTPA Terminate performance analysis 137 0 TTYPE Get terminal type 140 0 PHYADD Convert virtual to physical address, I-space 140 1 PEEKIO Peek into the I/O page 140 2 POKEIO Poke into the I/O page 140 3 BISIO Bit-set into the I/O page 140 4 BICIO Bit-clear into the I/O page 140 5 MAPIOP Map I/O page to user program 140 6 MAPMON Map simulated RMON to user program 140 7 LOKLOW Lock job in lowest memory 140 10 UNLOKJ Unlock job from memory 140 11 ATTVEC Attach completion routine to interrupt vector 140 12 RELVEC Release interrupt vector 140 13 LOKJOB Lock job in memory without re-positioning 140 14 STEALS Get exclusive system access 140 15 RTURNS Relinquish exclusive system access 140 16 SETPRI Set user mode priority level 140 17 MAPPHY Map to physical memory 140 20 ATTSVC Attach interrupt service routine 140 21 SCHCMP Schedule completion routine 140 22 PHYDAD Convert virtual to physical address, D-space *6.4* 140 23 GETPSW Get job's processor status word *6.5* 141 0 MEMTOP Set size of job 143 0 USERTS Associate with run-time system 143 1 MAPRTS Map run-time system into job 143 2 REGRTS Define shared run-time region for fast mapping 143 3 CLRRTS Clear region definitions for fast map 143 4 SIDON Enable separate I- and D-space mapping *6.4* 143 5 SIDOFF Disable separate I- and D-space mapping *6.4* 143 6 REGGBL Set up a global PLAS region for fast mapping *6.4* 143 7 SIDOVR Enable separate I- and D-space with overlays *6.5* 143 10 UPARC Enable user PAR control *6.5* 144 0 JSTAT Get job status information 145 FILINF Get file directory information 146 SFTIM Set file creation time 147 0 GTUNAM Get user name 147 1 STUNAM Set user name 147 2 GTPNAM Get program name 147 3 STPNAM Set program name 147 4 GTLNAM Get terminal line name *6.5* 147 5 STLNAM Set terminal line name *6.5* 150 0 SJBPRI Set job execution priority 150 1 GSJPRV Get/set job privileges 151 SPFLAG Enable/disable spooler flag pages *6.4* 151 SPHOLD Set spooler HOLD/NOHOLD 151 SPWIDE Set spooler flag page width *6.4* 152 0 SELOPT Set program controlled terminal options 153 0 NONINT Set [non]interactive job status Code Chan Name Description ---- ---- ---- ----------- 154 0 STTSPD Set speed, parity for a time-sharing line 154 1 STTXON Reset line XOFF status 154 2 RTTDTR Raise DTR for a line 154 3 LTTDTR Lower DTR for a line 155 0 GETCL Assign CL unit to a line 155 1 SCLXON Reset CL line XOFF status *6.4* 155 2 SCLRES Reset a CL line *6.4* 156 0 ALCDEV Allocate a device for exclusive use 156 1 DEALOC Deallocate a device from exclusive use 156 2 TSTALC Test device exclusive use allocation 157 0 MONJOB Start monitoring job status 157 1 NOMONJ Stop monitoring job status 157 2 STAMON Broadcast status to monitoring jobs 160 0 GETCXT Acquire another job's file context 161 0 MAKWIN Create a refreshable process window 161 1 SELWIN Select current process window 161 2 DELWIN Delete a process window 161 3 SPNWIN Suspend window processing 161 4 RSMWIN Resume window processing 161 5 PRTWIN Print window contents (via WINPRT) 162 0 GISUBP Initiate or switch to a sub-process 162 1 INISBP Initiate a sub-process 162 2 GOSUBP Switch to a sub-process 163 MNTLD Mount a logical disk % .sbttl . . . . . . . . . . . . Core Macros . . . . . . . . . . . . . ; Macros named TSXCnn are the "core" macros used to build other ; macros. Variables named TSXCVn are for use by the macros in this ; library. ; ; Numeric arguments for TSXCnn macros must **always** be octal! .sbttl TSXCM0 -- set up pointer to argument block; set up code .sbttl . and channel values; optional EMT 375 call .MACRO TSXCM0 EMTABK,CODE,CHANNEL=0,LAST .IF NDF TSXCV0 .MCALL TSXCM1,TSXCM,TSXCMB TSXCV0 = 0 .ENDC .IF NB .IF DIF ,R0 MOV EMTABK,R0 .ENDC MOV #^O'CHANNEL+<^O'CODE*^O400>,(R0) .ENDC .IIF NB EMT ^O375 .ENDM .sbttl TSXCM1 -- set up pointer to argument block; set up code and .sbttl . low-byte value; optional EMT 375 call .MACRO TSXCM1 EMTABK,CODE,ARGB,LAST .IF NDF TSXCV0 .MCALL TSXCM0,TSXCM,TSXCMB TSXCV0 = 0 .ENDC .IF IDN ,#0 TSXCM0 ,,, .MEXIT .ENDC .IF NB .IIF DIF ,R0 MOV EMTABK,R0 .IIF B MOVB #^O'CODE,1(R0) .IIF NB MOV #^O'CODE*^O400,(R0) .ENDC TSXCMB ,0, .ENDM .sbttl TSXCM -- move a word argument into argument block; .sbttl . optionally generate EMT 375 call .MACRO TSXCM ARG,OFFSET=2,LAST .IF NB .IF DIF ,#0 .IIF DIF ,<0> MOV ARG,^O'OFFSET(R0) .IIF IDN ,<0> MOV ARG,(R0) .IIF IDN ,<0> .ERROR; ?TSXMAC-W-Bad value -- use #0, not 0 ; .IFF .IIF DIF ,<0> CLR ^O'OFFSET(R0) .IIF IDN ,<0> CLR (R0) .ENDC .ENDC .IIF NB EMT ^O375 .ENDM .sbttl TSXCMB -- move a byte argument into argument block; .sbttl . optionally generate EMT 375 call .MACRO TSXCMB ARGB,OFFSET=2,LAST .IF NB .IF DIF ,#0 .IIF DIF ,<0> MOVB ARGB,^O'OFFSET(R0) .IIF IDN ,<0> MOVB ARGB,(R0) .IIF IDN ,<0> .ERROR; ?TSXMAC-W-Bad value -- use #0, not 0 ; .IFF .IIF DIF ,<0> CLRB ^O'OFFSET(R0) .IIF IDN ,<0> CLRB (R0) .ENDC .ENDC .IIF NB EMT ^O375 .ENDM .sbttl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .sbttl ABRTDJ -- Abort a detached job ; (Code 132, Channel 2) ; ; ABRTDJ area, job ; ; ABRTDJ is used, in theory, to abort detached jobs. In fact, it will ; kill any job if you have the necessary privilege. ABRTDJ is the same ; as the TSXMAC KILL macro; ABRTDJ is retained for consistency with ; the TSX-Plus documentation. ; ; area is the address of a two-word EMT argument block ; ; job is the job number of the detached job ; ; ; Format: R0 => .byte 2,132 ; .word job ; ; ; Errors: ; ; 0 Invalid subfunction (channel) code ; 1 Invalid detached job number ; 2 Insufficient privilege to kill specified job .MACRO ABRTDJ AREA,JOB .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,132,2 TSXCM ,,LAST .ENDM .sbttl ACTODT -- Reset/set ODT activation mode ; (Code 111, Channel 0/1) ; ; ACTODT area, odtflg ; ; ACTODT turns TSX-Plus ODT activation mode on or off. When this mode ; is on, all characters can be activitation characters except digits, ; commas, dollar signs, and semicolons. ; ; area is the address of a one-word EMT argument block ; ; odtflg ODT activation mode toggle; "odtflg" = 1 enables this ; this mode, "odtflg" = 0 turns it off ; ; ; Format: R0 => .byte odtflg,111 ; ; ; Errors: ; ; None documented .MACRO ACTODT AREA,ODTFLG .IIF NDF TSXCV0 .MCALL TSXCM1 .IIF DIF ,#1 TSXCM1 ,111,,LAST .IIF IDN ,#1 TSXCM0 ,111,1,LAST .ENDM .sbttl ALCDEV -- Allocate a device for exclusive use ; (Code 156, Channel 0) ; ; ALCDEV area, devptr ; ; ALCDEV allocates a device for the exclusive use of a single user. ; ; area is the address of a two-word EMT argument block ; ; devptr is the address of a four-word block containing the ; RAD50 name of the device in the first word, and zeros ; in the remaining three words ; ; ; Format: R0 => .byte 0,156 ; .word devptr ; ; ; Errors: ; ; 1 Device already allocated by another job (R0 = job) ; 2 Invalid device ; 3 Device allocation table full (MAXALC parameter) ; 4 Device currently in use by another job (R0 = job) ; 5 Job does not have ALLOCATE privilege .MACRO ALCDEV AREA,DEVPTR .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,156 TSXCM ,,LAST .ENDM .sbttl ATTSVC -- Attach interrupt service routine ; (Code 140, Channel 20) ; ; ATTSVC area, vector, isr ; ; ATTSVC is used to connect a job's interrupt service routine to an ; interrupt vector. You must have REALTIME privilege. See the TSX-Plus ; documentation for other job restrictions. Use the RELVEC request to ; disconnect from the interrupt vector. ; ; area is the address of a four-word EMT argument block ; ; vector is the interrupt vector address ; ; isr is the address of the interrupt service routine entry ; point ; ; ; Format: R0 => .byte 20,140 ; .word vector ; .word isr ; .word 0 ; ; ; Errors: ; ; 0 No real time support or job not privileged ; 1 Maximum number of vectors exceeded ; 2 Another job is already attached to that vector ; 3 Job not locked into memory .MACRO ATTSVC AREA,VECTOR,ISR .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,20 TSXCM TSXCM ,4 TSXCM #0,6,LAST .ENDM .sbttl ATTVEC -- Attach completion routine to interrupt vector ; (Code 140, Channel 11) ; ; ATTVEC area, vector, crtn, rtpri ; ; ATTVEC is used to connect a completion routine to an interrupt ; vector. You must have REALTIME privilege. See the TSX-Plus ; documentation for other job restrictions. Use the RELVEC request to ; disconnect from the interrupt vector. ; ; area is the address of a four-word EMT argument block ; ; vector is the interrupt vector address ; ; crtn is the address of the completion routine entry point ; ; rtpri is the execution priority for the completion routine ; ; ; Format: R0 => .byte 11,140 ; .word vector ; .word crtn ; .word rtpri ; ; ; Errors: ; ; 0 No real time support or job not privileged ; 1 Maximum number of vectors exceeded ; 2 Another job is already attached to that vector ; 3 Job not locked into memory .MACRO ATTVEC AREA,VECTOR,CRTN,RTPRI .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,11 TSXCM TSXCM ,4 TSXCM ,6,LAST .ENDM .sbttl BICIO -- Bit-clear into the I/O page ; (Code 140, Channel 4) ; ; BICIO area, addres, mask ; ; BICIO is used to perform a bit-clear operation on a word at a ; specified location in the I/O page without the necessity of the ; program actually mapping to the I/O page. ; ; area is the address of a three-word EMT argument block ; ; addres is the address of the word to be accessed ; ; mask is the bit mask value to be used at the specified ; word address ; ; ; Format: R0 => .byte 4,140 ; .word addres ; .word mask ; ; ; Errors: ; ; 0 Calling program does not have sufficient privilege ; (MEMMAP required) ; ; Program will abort with "Kernel mode trap" error if invalid ; address specified .MACRO BICIO AREA,ADDRES,MASK .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,4 TSXCM TSXCM ,4,LAST .ENDM .sbttl BISIO -- Bit-set into the I/O page ; (Code 140, Channel 3) ; ; BISIO area, addres, mask ; ; BISIO is used to perform a bit-set operation on a word at a ; specified location in the I/O page without the necessity of the ; program actually mapping to the I/O page. ; ; area is the address of a three-word EMT argument block ; ; addres is the address of the word to be accessed ; ; mask is the bit mask value to be set at the specified ; word address ; ; ; Format: R0 => .byte 3,140 ; .word addres ; .word mask ; ; ; Errors: ; ; 0 Insufficient privilege (MEMMAP required) ; ; Program will abort with "Kernel mode trap" error if invalid ; address specified .MACRO BISIO AREA,ADDRES,MASK .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,3 TSXCM TSXCM ,4,LAST .ENDM .sbttl CKACT -- Check for activation characters ; (Code 123, Channel 0) ; ; CKACT area ; ; CKACT checks for the presence of pending, unprocessed activation ; characters. ; ; area is the address of a one-word EMT argument block. ; ; ; Format: R0 => .byte 0,123 ; ; ; Errors: ; ; 0 No activation characters are pending .MACRO CKACT AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,123,,LAST .ENDM .sbttl CKTTIE -- Check for terminal input errors ; (Code 116, Channel 0) ; ; CKTTIE area ; ; CKTTIE is used to check if any terminal input errors have occurred. ; A return with the carry bit clear indicates that no errors occurred. ; If carry is set, either a hardware error occurred, or the monitor's ; input buffer overflowed. ; ; area is the address of a one-word EMT argument block. ; ; ; Format: R0 => .byte 0,116 ; ; ; Errors: ; ; 0 Terminal input error occurred .MACRO CKTTIE AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,116,,LAST .ENDM .sbttl CKWSHR -- Check for writes to shared file ; (Code 121) ; ; CKWSHR area, chan ; ; CKWSHR checks to see if any other user has written to a shared file ; since the job opened the specified file or since the last time ; CKWSHR was invoked. If the file has been modified since the last ; check, error code 2 is returned. RLOCK privilege is required. See ; the TSX-Plus documentation on shared-file record locking for more ; information. ; ; area is the address of a one-word EMT argument block ; ; chan channel on which shared file is open ; ; ; Format: R0 => .byte chan,121 ; ; ; Errors: ; ; 0 Insufficient privilege (RLOCK required) or no shared- ; file support ; 2 Another job has written to file since last chack .MACRO CKWSHR AREA,CHAN .IIF NDF TSXCV0 .MCALL TSXCM1 TSXCM1 ,121,,LAST .ENDM .sbttl CLRRTS -- Clear region definitions for fast map ; (Code 143, Channel 3) ; ; CLRRTS area ; ; CLRRTS clears all fast mapping region definitions, returning the ; TRAP instruction to its normal function. ; ; area is the address of a one-word EMT argument block ; ; ; Format: R0 => .byte 3,143 ; ; ; Errors: ; ; None documented .MACRO CLRRTS AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,143,3,LAST .ENDM .sbttl DCLBRK -- Establish break sentinel control ; (Code 133, Channel 0) ; ; DCLBRK area, brkchr, cmprtn ; ; DCLBRK is used to trigger a specified completion when the "BREAK" ; key is pressed or a specified character is entered. Specifying 0 for ; the break character causes only the "BREAK" key to be used. ; Specifying an address of 0 for the completion routine disables break ; sentinal action. On return, R0 contains the address of any previous ; completion routine connected to the break sentinal character; R0 = 0 ; if no routine was previously connected. Note that the completion ; routine only remains in effect for one break character and that only ; one break routine may be active for a given program. ; ; area is the address of a three-word EMT argument block ; ; brkchr is the user-defined "break" character. ; ; cmprtn is the address of a completion routine. ; ; ; Format: R0 => .byte 0,133 ; .word brkchr ; .word cmprtn ; ; ; Errors: ; ; None documented .MACRO DCLBRK AREA,BRKCHR,CMPRTN .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,133 TSXCM TSXCM ,4,LAST .ENDM .sbttl DEALOC -- Deallocate a device from exclusive use ; (Code 156, Channel 1) ; ; DEALOC area, devptr ; ; DEALOC deallocates a device from the exclusive use of a single user. ; ; area is the address of a two-word EMT argument block ; ; devptr is the address of a four-word block containing the ; RAD50 name of the device in the first word, and zeros ; in the remaining three words ; ; ; Format: R0 => .byte 1,156 ; .word devptr ; ; ; Errors: ; ; 2 Invalid device ; 5 Job does not have ALLOCATE privilege .MACRO DEALOC AREA,DEVPTR .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,156,1 TSXCM ,,LAST .ENDM .sbttl DELWIN -- Delete a process window ; (Code 161, Channel 2) ; ; DELWIN area, winid ; ; DELWIN deletes a specified process window. A window ID of zero ; deletes all of the job's temporary process windows; a value of 255 ; deletes all windows. ; ; area is the address of a three-word EMT argument block ; ; winid window identification number (1 - 26); 0 deletes all ; temporary windows, 255 deletes all windows ; ; ; Format: R0 => .byte 2,161 ; .byte winid, 0 ; .word 0 ; ; ; Errors: ; ; 0 Window management not available or invalid EMT ; argument block ; 3 Unable to locate specified window .MACRO DELWIN AREA,WINID .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,161,2 TSXCMB TSXCMB #0,3 TSXCM #0,4,LAST .ENDM .sbttl DISMNT -- Dismount a directory structure ; (Code 135, Channel 0) ; ; DISMNT area, device ; ; DISMNT is the equivalent of the "DISMOUNT device" command. (But not ; the same as the DISMOUNT command used to dismount logical devices.) ; It tells TSX-Plus to disable directory caching on a specific drive. ; ; area is the address of a three-word EMT argument block ; ; device is the address of a word containing the RAD50 name of ; the device on which the file structure resides ; ; ; Format: R0 => .byte 0,135 ; .word device ; .word 0 ; ; ; Errors: ; ; None documented .MACRO DISMNT AREA,DEVICE .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,135 TSXCM TSXCM #0,4,LAST .ENDM .sbttl DMTALD -- Dismount all logical disks ; (Code 135, Channel 5) ; ; DMTALD area ; ; DMTALD dismounts all logical disks. It is equivalent to the SET LD ; EMPTY command. ; ; area is the address of a two-word EMT argument block ; ; ; Format: R0 => .byte 5,135 ; .word 0 ; ; ; Errors: ; ; 3 A channel is open to a file on a logical disk .MACRO DMTALD AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,135,5 TSXCM #0,,LAST .ENDM .sbttl DMTFLS -- Dismount all mounted file structures ; (Code 135, Channel 2) ; ; DMTFLS area ; ; DMTFLS stops caching on all file structures, including logical ; disks. It does not actually dismount logical disks; they're still ; accessible. ; ; area is the address of a two-word EMT argument block ; ; ; Format: R0 => .byte 2,135 ; .word 0 ; ; ; Errors: ; ; Documentation example shows carry set if "unable to dismount ; all files (sic) structures." .MACRO DMTFLS AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,135,2 TSXCM #0,,LAST .ENDM .sbttl DMTLD -- Dismount a logical disk ; (Code 135, Channel 3) ; ; DMTLD area, ldunit ; ; DMTLD dismounts a specific LD unit. It is equivalent to typing ; DISMOUNT LDn. ; ; area is the address of a two-word EMT argument block ; ; ldunit is the number of the LD unit to be dismounted ; ; ; Format: R0 => .byte 3,135 ; .byte ldunit,0 ; ; ; Errors: ; ; 0 LD unit not associated with file ; 1 Invalid LD unit number ; 3 A channel is open to a file on a logical disk .MACRO DMTLD AREA,LDUNIT .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,135,3 TSXCMB TSXCMB #0,3,LAST .ENDM .sbttl FILINF -- Get file directory information ; (Code 145) ; ; FILINF area, chan, dblk, rblk ; ; FILINF is used to return directory information about a specified ; file. ; ; area is the address of a three-word EMT argument block ; ; chan an I/O channel number not currently in use ; ; dblk address of a four-word data block containing the RAD50 ; file specification ; ; rblk address of a seven-word block to receive the file ; information: ; word 0: File size, in blocks ; word 1: 0 = protected; 1 = protected ; word 2: File creation date ; word 3: File creation time ; word 4: Starting block number ; word 5: Unused (reserved) ; word 6: Unused (reserved) ; ; ; Format: R0 => .byte chan,145 ; .word dblk ; .word rblk ; ; ; Errors: ; ; 0 Channel currently in use ; 1 Unable to find file ; 2 Device not file structured .MACRO FILINF AREA,CHAN,DBLK,RBLK .IIF NDF TSXCV0 .MCALL TSXCM1 TSXCM1 ,145, TSXCM TSXCM ,4,LAST .ENDM .sbttl GETCL -- Assign CL unit to a line ; (Code 155, Channel 0) ; ; GETCL area, unit, line ; ; GETCL assigns a CL unit to a specified line. It is equivalent to ; the SET CLn LINE=n command. If the line number is zero, the CL unit ; is disassociated from any line. TERMINAL privilege is required. ; ; area is the address of a three-word EMT argument block ; ; unit is a CL unit number ; ; line is the number of a time-sharing line or dedicated ; CL line ; default: LINE = #0 ; ; ; Format: R0 => .byte 0,155 ; .word unit ; .word line ; ; ; Errors: ; ; 1 Insufficient privilege (TERMINAL required) ; 2 Invalid CL unit number ; 3 Invalid line number ; 4 Specified line already assigned to a CL unit ; 5 A user is logged on to the specified line ; 6 Specified CL unit is busy .MACRO GETCL AREA,UNIT,LINE=#0 .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,155 TSXCM TSXCM ,4,LAST .ENDM .sbttl GETCXT -- Acquire another job's file context ; (Code 160, Channel 0) ; ; GETCXT area, job ; ; GETCXT acquires the file context of another job. Essentially, the ; file context of the target job replaces that of the issuing job. See ; the TSX-Plus documentation for the details. GETCXT privilege is ; required unless the target job is the parent process. ; ; area is the address of a three-word EMT argument block ; ; job number of job whose file context is to be acquired ; ; ; Format: R0 => .byte 0,160 ; .word job ; .word 0 ; ; ; Errors: ; ; 0 Insufficient privilege (GETCXT required) ; 1 Target job number invalid or not logged on .MACRO GETCXT AREA,JOB .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,160 TSXCM TSXCM #0,4,LAST .ENDM .sbttl GETMSG -- Get message from named channel ; (Code 105, Channel 0) ; ; GETMSG area, chname, mesage, msgsiz ; ; GETMSG gets a message on a named channel. R0 contains the received ; message length. The message is truncated if it is too long for the ; job's message buffer. If no message is pending, error code 3 is ; returned. MESSAGE privilege is required. ; ; area is the address of a four-word EMT argument block ; ; chname address of six-byte ASCII message channel name ; ; mesage address of beginning of job's message buffer ; ; msgsiz length of job's message buffer, in bytes ; ; ; Format: R0 => .byte 0,105 ; .word chname ; .word mesage ; .word msgsiz ; ; ; Errors: ; ; 0 Insufficient privilege (MESSAGE required) or no ; message channel support on system ; 1 All message channels busy ; 3 No message in queue on named channel ; 4 Message longer than receiving buffer; truncated to ; buffer length ; 5 Maximum number of message requests pending .MACRO GETMSG AREA,CHNAME,MESAGE,MSGSIZ .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,105 TSXCM TSXCM ,4 TSXCM ,6,LAST .ENDM .sbttl GETPSW -- Get job's processor status word *6.5* ; (Code 140, Channel 23) ; ; GETPSW area ; ; GETPSW returns the value of the current job processor status word ; (PSW) in R0. The TSX-Plus emulation of the RT-11 .MFPS request ; always returns 0, the normal case for user jobs. Also, .MFPS will ; fail with a trap to 4 if the job is not mapped to the simulated ; RMON. GETPSW will return the actual PSW value even if the job is not ; mapped to RMON. ; ; area is the address of a one-word EMT argument block ; ; ; Format: R0 => .byte 23,140 ; ; ; Errors: ; ; None .MACRO GETPSW AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,23,LAST .ENDM .sbttl GISUBP -- Initiate or switch to a sub-process ; (Code 162, Channel 0) ; ; GISUBP area, sbpnum, rtrnpr, init, cmdfil ; ; GISUBP initiates, and switches to, a specified subprocess. If the ; initiate- only flag (INIT) is set, GISUBP does not switch terminal ; control. If the subprocess is already active, GISUBP simply switches ; to it. Using GISUBP is analogous to typing "control-W n" at the ; console, where "n" is the subprocess number. ; ; ; area is the address of a five-word EMT argument block ; ; sbpnum subprocess number (0 - MAXSEC); if 0, switches to ; primary process; -1 causes system to select next ; available unused subprocess number ; ; rtrnpr return process flag; 0 returns to primary process ; after specified subprocess logs off, 1 returns to ; process executing GISUBP request ; ; init initiate-only flag; 0 switches control to specified ; subprocess, 1 leaves terminal control with current ; process ; ; cmdfil address of ASCIZ name of command file to execute when ; specified subprocess initiated; 0 if no command file ; to execute ; ; ; Format: R0 => .byte 0,162 ; .byte sbpnum, 0 ; .byte rtrnpr, init ; .word cmdfil ; .word 0 ; ; ; Errors: ; ; 1 Not privileged to use subprocesses ; 2 Subprocess number too large (MAXSEC value in R0) ; 3 All subprocesses already active ; 4 Insufficient memory for process .MACRO GISUBP AREA,SBPNUM,RTRNPR,INIT,CMDFIL .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,162 TSXCMB TSXCMB #0,3 TSXCMB ,4 TSXCMB ,5 TSXCM ,6 TSXCM #0,10,LAST .ENDM .sbttl GOSUBP -- Switch to a sub-process ; (Code 162, Channel 2) ; ; GOSUBP area, sbpnum ; ; GOSUBP switches control to a specified active subprocess. If the ; subprocess is not active, error code 6 is returned. Using GOSUBP is ; analogous to typing "control-W n" at the console, where "n" is the ; number of a currently active subprocess. ; ; ; area is the address of a five-word EMT argument block ; ; sbpnum subprocess number (0 - MAXSEC); if 0, switches to ; primary process ; ; ; Format: R0 => .byte 2,162 ; .byte sbpnum, 0 ; .word 0 ; .word 0 ; .word 0 ; ; ; Errors: ; ; 1 Not privileged to use subprocesses ; 2 Subprocess number too large (MAXSEC value in R0) ; 6 Subprocess not initiated .MACRO GOSUBP AREA,SBPNUM .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,162,2 TSXCMB TSXCMB #0,3 TSXCM #0,4 TSXCM #0,6 TSXCM #0,10,LAST .ENDM .sbttl GSJPRV -- Get/set job privileges ; (Code 150, Channel 1) ; ; GSJPRV area, func, prvtyp, buffer ; ; GSJPRV gets or sets job privileges. The PRVDEF macro can be used to ; define a set of symbols for the TSX-Plus privilege flags. Also, the ; description of the PRVDEF macro includes a summary of the various ; privileges. See the TSX-Plus System Manager's Guide for detailed ; information on job privileges. ; ; area is the address of a four-word EMT argument block ; ; func type of operation to execute: ; 0 -- Read job's privilege flags ; 1 -- Clear specified privilege flags ; 2 -- Set specified privilege flags ; ; prvtyp privilege table to access: ; 0 -- Current privileges ; 1 -- Set privileges ; 2 -- Authorized privileges ; ; buffer address of a four-word buffer to receive privilege ; flag data or which contains the privilege flags to be ; set/cleared ; ; ; Format: R0 => .byte 1,150 ; .byte func,prvtyp ; .word buffer ; .word 0 ; ; ; Errors: ; ; 1 Attempt to enable privileges for which job not ; authorized; only authorized privileges are set .MACRO GSJPRV AREA,FUNC,PRVTYP,BUFFER .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,150,1 TSXCMB TSXCMB ,3 TSXCM ,4 TSXCM #0,6,LAST .ENDM .sbttl GTINCH -- Get number of pending input characters ; (Code 116, Channel 1) ; ; GTINCH area ; ; GTINCH is used to determine the number of pending input characters. ; The number of characters is returned in R0. ; ; area is the address of a one-word EMT argument block. ; ; ; Format: R0 => .byte 1,116 ; ; ; Errors: ; ; None documented .MACRO GTINCH AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,116,1,LAST .ENDM .sbttl GTLNAM -- Get terminal line name *6.5* ; (Code 147, Channel 4) ; ; GTLNAM area, name, line ; ; GTLNAM returns the name of a specified terminal line. Line names may ; be up to 12 characters (bytes) in length. Use STLNAM to set or ; change the line name. ; ; area is the address of a three-word EMT argument block ; ; name address of the buffer to contain the line name ; ; line is the line number ; ; Format: R0 => .byte 4,147 ; .word name ; .word line ; ; ; Errors: ; ; None documented .MACRO GTLNAM AREA,NAME,LINE .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,147,4 TSXCM TSXCM ,4,LAST .ENDM .sbttl GTPNAM -- Get program name ; (Code 147, Channel 2) ; ; GTPNAM area, name ; ; GTPNAM returns the name of the current program. ; ; area is the address of a two-word EMT argument block ; ; name address of the two-word buffer to contain the program ; name (returned in RADIX-50 format) ; ; Format: R0 => .byte 2,147 ; .word name ; ; ; Errors: ; ; 2 Name not specified in RADIX-50 .MACRO GTPNAM AREA,NAME .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,147,2 TSXCM ,,LAST .ENDM .sbttl GTUNAM -- Get user name ; (Code 147, Channel 0) ; ; GTUNAM area, name ; ; GTUNAM is used to retrieve the user name. ; ; area is the address of a two-word EMT argument block ; ; name address of a 12-byte buffer to contain the user name ; (ASCII format) ; ; ; Format: R0 => .byte 0,147 ; .word name ; ; ; Errors: ; ; None documented .MACRO GTUNAM AREA,NAME .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,147 TSXCM ,,LAST .ENDM .sbttl GVLDEF -- Define TSX-Plus .GVAL offsets *Utility Macro* ; (Utility Macro) ; ; GVLDEF (no arguments) ; ; GVLDEF defines a standard set of symbols for use in obtaining ; TSX-Plus system values with the .GVAL programmed request. ; Specifically, GVLDEF defines the offsets that are unique to ; TSX-Plus. See the beginning of Chapter 4 of the TSX-Plus ; Programmer's Reference Manual for more details. ; ; Symbol Offset System Value ; ------ ------ ------------ ; TSJOBN =: - 2. Job number ; TSLICH =: - 4. Lead-in character for terminal control options ; TSSYSP =: - 6. 1 if job has SYSPRV privilege; 0 if not ; TSPAR7 =: - 8. 1 if PAR 7 mapped to I/O page; 0 if not ; TSPRJN =: -10. Project number ; TSPRGN =: -12. Programmer number ; TSLICN =: -14. TSX-Plus incremental license number ; TSJPRI =: -16. Current job priority ; TSMXJP =: -18. Maximum allowed job priority ; TSUCLB =: -20. Number of blocks per user in TSXUCL.TSX ; TSPRPN =: -22. Job number of primary process ; TSSYDV =: -24. Name of boot-time system device in RAD50 ; TSMFLO =: -26. Maximum fixed-low-priority value ; TSMFHI =: -28. Minimum fixed-high-priority value ; TSPAPN =: -30. Job number of parent process ; TSVRZN =: -32. System version number (decimal value * 100.) ; TSRSPN =: -34. Relative subprocess number .MACRO GVLDEF TSJOBN =: - 2. TSLICH =: - 4. TSSYSP =: - 6. TSPAR7 =: - 8. TSPRJN =: -10. TSPRGN =: -12. TSLICN =: -14. TSJPRI =: -16. TSMXJP =: -18. TSUCLB =: -20. TSPRPN =: -22. TSSYDV =: -24. TSMFLO =: -26. TSMFHI =: -28. TSPAPN =: -30. TSVRZN =: -32. TSRSPN =: -34. .ENDM .sbttl HALTPA -- Terminate performance analysis ; (Code 136, Channel 3) ; ; HALTPA area, params, histo, bfsize ; ; HALTPA terminates a performance analysis, returns the resultant ; data to a user buffer, and frees the performance analysis feature ; for use by other jobs. ; ; area is the address of a four-word EMT argument block ; ; params address of four-word buffer to receive analysis ; parameters: ; - base address of monitored region ; - top address of monitored region ; - number of bytes per histogram cell ; - control and status flags: ; 000001 -- I/O wait time included ; 100000 -- Histogram cell overflow ; ; histo address of buffer for histogram count values ; ; bfsize size, in bytes, of histogram buffer ; ; ; Format: R0 => .byte 3,136 ; .word params ; .word histo ; .word bfsize ; ; ; Errors: ; ; 0 No performance analysis in progress ; 1 Histogram buffer too small .MACRO HALTPA AREA,PARAMS,HISTO,BFSIZE .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,136,3 TSXCM TSXCM ,4 TSXCM ,6,LAST .ENDM .sbttl HIEFF -- Reset/set high-efficiency terminal mode ; (Code 120, Channel 0/1) ; ; HIEFF area, rsflg ; ; HIEFF turns terminal high-efficiency input mode on or off. ; ; area is the address of a one-word EMT argument block. ; ; rsflg is the high-efficency mode toggle; "rsflg" = 0 turns ; it off, "rsflg" = 1 turns it on. ; ; ; Format: R0 => .byte rsflg,120 ; ; ; Errors: ; ; None documented .MACRO HIEFF AREA,RSFLG .IIF NDF TSXCV0 .MCALL TSXCM0,TSXCM1 .IIF DIF ,#1 TSXCM1 ,120,,LAST .IIF IDN ,#1 TSXCM0 ,120,1,LAST .ENDM .sbttl INISBP -- Initiate a sub-process ; (Code 162, Channel 1) ; ; INISBP area, sbpnum, rtrnpr, init, cmdfil ; ; INISBP initiates, and switches to, a specified subprocess. If the ; initiate- only flag (INIT) is set, INISBP does not switch terminal ; control. If the subprocess is already active, error code 5 is ; returned. Using INISBP is analogous to typing "control-W n" at the ; console, where "n" is the number of a new subprocess. ; ; ; area is the address of a five-word EMT argument block ; ; sbpnum subprocess number (1 - MAXSEC); -1 causes system to ; select next available unused subprocess number ; ; rtrnpr return process flag; 0 returns to primary process ; after specified subprocess logs off, 1 returns to ; process executing INISBP request ; ; init initiate-only flag; 0 switches control to specified ; subprocess, 1 leaves terminal control with current ; process ; ; cmdfil address of ASCIZ name of command file to execute when ; specified subprocess initiated; 0 if no command file ; to execute ; ; ; Format: R0 => .byte 1,162 ; .byte sbpnum, 0 ; .byte rtrnpr, init ; .word cmdfil ; .word 0 ; ; ; Errors: ; ; 1 Not privileged to use subprocesses ; 2 Subprocess number too large (MAXSEC value in R0) ; 3 All subprocesses already active ; 4 Insufficient memory for process ; 5 Subprocess already initiated .MACRO INISBP AREA,SBPNUM,RTRNPR,INIT,CMDFIL .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,162,1 TSXCMB TSXCMB #0,3 TSXCMB ,4 TSXCMB ,5 TSXCM ,6 TSXCM #0,10,LAST .ENDM .sbttl INITPA -- Initialize performance analysis ; (Code 136, Channel 0) ; ; INITPA area, base, top, celsiz, iowait ; ; INITPA sets up the parameters that will control a performance ; analysis. ; ; area is the address of a five-word EMT argument block ; ; base address of the base of the region to be monitored ; ; top address of the top of the region to be monitored ; ; celsiz number of bytes to group in each histogram cell; ; if zero, cell size calculated automatically ; default: CELSIZ = #0 ; ; iowait I/O wait flag; if zero, I/O wait time not included; ; if one, it is included ; default: IOWAIT = #0 ; ; ; Format: R0 => .byte 0,136 ; .word base ; .word top ; .word celsiz ; .word iowait ; ; ; Errors: ; ; 0 Performance analysis being done by another user ; 1 Performance analysis feature not available .MACRO INITPA AREA,BASE,TOP,CELSIZ=#0,IOWAIT=#0 .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,136 TSXCM TSXCM ,4 TSXCM ,6 TSXCM ,10,LAST .ENDM .sbttl JSTAT -- Get job status information ; (Code 144, Channel 0) ; ; JSTAT area, line, func, buff ; ; JSTAT is used to obtain various types of status information about a ; specific job. Interpretation of the status data varies with the ; particular sub-function (FUNC) requested. See the TSX-Plus ; documentation for a more detailed discussion. Note that sub-function ; #10 is documented in the V6.4 release notes. ; ; area is the address of a three-word EMT argument block ; ; line number of the job for the job status query ; ; func the specific job status query requested: ; #0 -- check line status ; #1 -- get job's execution state ; #2 -- get amount of memory used by job ; #3 -- get job's connect time ; #4 -- get job's memory position ; #5 -- get currently running program name ; #6 -- get PPN ; #7 -- get CPU time used by job ; #8 -- get current job execution priority ; #9 -- get job name ; #10 -- get job numbers of primary and parent ; processes (V6.4 or later only) ; ; buff address of a two-word status result buffer; ; exception: at least 6 words if FUNC = #9 ; ; ; Format: R0 => .byte 0,144 ; .byte line,func ; .word buff ; ; ; Errors: ; ; 0 Specified line not logged on ; 1 Invalid function code ; 2 Invalid line number .MACRO JSTAT AREA,LINE,FUNC,BUFF .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,144 TSXCMB TSXCMB ,3 TSXCM ,4,LAST .ENDM .sbttl KILL -- Abort a job ; (Code 132, Channel 2) ; ; KILL area, job ; ; KILL aborts a job of any type, if you have the necessary privilege. ; KILL is the same as the ABRTDJ macro. ; ; area is the address of a two-word EMT argument block ; ; job is the job number ; ; ; Format: R0 => .byte 2,132 ; .word job ; ; ; Errors: ; ; 0 Invalid subfunction (channel) code ; 1 Invalid detached job number ; 2 Insufficient privilege to kill specified job .MACRO KILL AREA,JOB .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,132,2 TSXCM ,,LAST .ENDM .sbttl LDSTAT -- Get status of a logical disk ; (Code 135, Channel 4) ; ; LDSTAT area, ldunit, buffer ; ; LDSTAT gets the status of a particular logical disk unit. ; ; area is the address of a three-word EMT argument block ; ; ldunit LD unit number ; ; buffer address of five-word buffer to receive status ; information: ; word 0 - 3: RAD50 name of mounted device/file; ; all zeros if not mounted ; word 4: if bit 0 set, read-only ; if bit 1 set, not accessible ; ; ; Format: R0 => .byte 4,135 ; .byte ldunit,0 ; .word buffer ; ; ; Errors: ; ; 1 Invalid LD unit number .MACRO LDSTAT AREA,LDUNIT,BUFFER .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,135,4 TSXCMB TSXCMB #0,3 TSXCM ,4,LAST .ENDM .sbttl LOCKW -- Wait for locked block ; (Code 102) ; ; LOCKW area, chan, block ; ; LOCKW attempts to lock a specified block in a shared file. If the ; block is already locked, LOCKW waits until the block becomes ; available. RLOCK privilege is required. See the TSX-Plus ; documentation on shared-file record locking for more information. ; ; area is the address of a two-word EMT argument block ; ; chan channel on which shared file is open ; ; block the number of the block in the shared file to be ; locked ; ; ; Format: R0 => .byte chan,102 ; .word block ; ; ; Errors: ; ; 0 Insufficient privilege (RLOCK required) or no shared- ; file support ; 1 Channel not open to a shared file ; 2 Attempt to lock too many blocks in file .MACRO LOCKW AREA,CHAN,BLOCK .IIF NDF TSXCV0 .MCALL TSXCM1 TSXCM1 ,102, TSXCM ,,LAST .ENDM .sbttl LOKJOB -- Lock job in memory without re-positioning ; (Code 140, Channel 13) ; ; LOKJOB area ; ; LOKJOB locks a program in memory, preventing swapping. PSWAPM ; privilege is required. ; ; area is the address of a one-word EMT argument block ; ; ; Format: R0 => .byte 13,140 ; ; ; Errors: ; ; 0 Insufficient privilege (PSWAPM required) .MACRO LOKJOB AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,13,LAST .ENDM .sbttl LOKLOW -- Lock job in lowest memory (re-positioning if .sbttl . necessary) ; (Code 140, Channel 7) ; ; LOKLOW area ; ; LOKLOW locks a program in low memory. The job is repositioned if ; necessary. PSWAPM privilege is required. ; ; area is the address of a one-word EMT argument block ; ; ; Format: R0 => .byte 7,140 ; ; ; Errors: ; ; 0 Insufficient privilege (PSWAPM required) .MACRO LOKLOW AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,7,LAST .ENDM .sbttl LTTDTR -- Lower DTR for a line ; (Code 154, Channel 3) ; ; LTTDTR area, line ; ; LTTDTR is used to lower the DTR (data terminal ready) signal of a ; time-sharing line. It is equivalent to the KMON command SET TT n ; NODTR. TERMINAL privilege is required. ; ; area is the address of a two-word EMT argument block ; ; line is the line number of the time-sharing line to be ; affected. If the line number is zero, the affected ; line is the line issuing the EMT. ; ; ; Format: R0 => .byte 3,154 ; .word line ; ; ; Errors: ; ; 1 Insufficient privilege (TERMINAL required) ; 2 Invalid line number .MACRO LTTDTR AREA,LINE .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,154,3 TSXCM ,,LAST .ENDM .sbttl MAKWIN -- Create a refreshable process window ; (Code 161, Channel 0) ; ; MAKWIN area, winid, prmflg, width, mxscrl, cpyid, cpyjob ; ; MAKWIN creates a process window. The details of all this simply ; must be acquired from the TSX-Plus documentation. ; ; area is the address of a five-word EMT argument block ; ; winid window identification number (1 - 26) ; ; prmflg if 0, window deleted on program exit; if 1, must be ; explicitly deleted ; ; width width of window (maximum = 132 columns) ; ; mxscrl maximum lines that can scroll off window while it is ; disconnected; 0 disables this; 255 allows unlimited ; scrolling ; ; cpyid if non-zero, copy initial window parameters from window ; with this ID ; default: CPYID = #0 ; ; cpyjob number of job owning window from which initial ; parameters are to be copied; if zero, implies current ; job ; default: CPYJOB = #0 ; ; ; Format: R0 => .byte 0,161 ; .byte winid, prmflg ; .byte width, mxscrl ; .byte cpyid, cpyjob ; .word 0 ; ; Errors: ; ; 0 Window management not available or invalid EMT ; argument block ; 1 Maximum number of windows already in use ; (MAXWIN parameter exceeded) ; 2 Unable to create named global region for window .MACRO MAKWIN AREA,WINID,PRMFLG,WIDTH,MXSCRL,CPYID=#0,CPYJOB=#0 .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,161 TSXCMB ,2 TSXCMB ,3 TSXCMB ,4 TSXCMB ,5 TSXCMB ,6 TSXCMB ,7 TSXCM #0,10,LAST .ENDM .sbttl MAPIOP -- Map I/O page to user program ; (Code 140, Channel 5) ; ; MAPIOP area ; ; MAPIOP maps a program's PAR7 address region (160000 - 177777) to ; the I/O page (mapping can be restored with the MAPMON request). ; MEMMAP privilege is required. ; ; area is the address of a one-word EMT argument block ; ; ; Format: R0 => .byte 5,140 ; ; ; Errors: ; ; 0 Job has insufficient privilege (MEMMAP required) .MACRO MAPIOP AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,5,LAST .ENDM .sbttl MAPMON -- Map simulated RMON to user program ; (Code 140, Channel 6) ; ; MAPMON area ; ; MAPMON restores a program's PAR7 mapping if it has previously been ; mapped to the I/O page (see MAPIOP request). MEMMAP privilege is ; required. ; ; area is the address of a one-word EMT argument block ; ; ; Format: R0 => .byte 6,140 ; ; ; Errors: ; ; 0 Job has insufficient privilege (MEMMAP required) .MACRO MAPMON AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,6,LAST .ENDM .sbttl MAPPHY -- Map to physical memory ; (Code 140, Channel 17) ; ; MAPPHY area, par, phyadr, size, access, bypass ; ; MAPPHY maps a program's virtual address space to a specific area in ; physical memory. Invoke this request with a SIZE argument of zero to ; restore the default program mapping. MEMMAP privilege is required. ; ; area is the address of a five-word EMT argument block ; ; par is the number of the Page Address Register (PAR) ; associated with the beginning of the program virtual ; address region that is to be mapped ; ; phyadr is the actual physical address, divided by 64., to ; which the virtual address is to be mapped ; ; size number of 64-byte blocks of memory to be mapped; ; additional PARs will be used if this exceeds 8 Kb ; ; access One if access is to be read/write, zero for read-only; ; default: ACCESS=#1 (read/write) ; ; bypass 0 if hardware cache is not to be bypassed, 1 otherwise ; default: BYPASS=#0 (no bypass) ; ; ; Format: R0 => .byte 17,140 ; .word par ; .word phyadr ; .word size ; .byte access, bypass ; ; ; Errors: ; ; 0 Job has insufficient privilege (MEMMAP required) .MACRO MAPPHY AREA,PAR,PHYADR,SIZE,ACCESS=#1,BYPASS=#0 .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,17 TSXCM TSXCM ,4 TSXCM ,6 TSXCMB ,10 TSXCMB ,11,LAST .ENDM .sbttl MAPRTS -- Map run-time system into job ; (Code 143, Channel 1) ; ; MAPRTS area, par, offset, size ; ; MAPRTS maps a previously associated run-time system (see USERTS ; request) into a job's virtual address space. ; ; area is the address of a four-word EMT argument block ; ; par is the number of the Page Address Register (PAR) ; associated with the beginning of the program virtual ; address region that is to be mapped to the run-time ; system ; ; offset the offset, in 64-byte blocks, from the beginning of ; the run-time system to where mapping is to begin ; ; size the size of the region in 64-byte blocks; if size ; exceeds 8Kb, additional PAR regions are automatically ; mapped ; ; ; Format: R0 => .byte 1,143 ; .word par ; .word offset ; .word size ; ; ; Errors: ; ; 1 No run-time system associated with job .MACRO MAPRTS AREA,PAR,OFFSET,SIZE .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,143,1 TSXCM TSXCM ,4 TSXCM ,6,LAST .ENDM .sbttl MEMTOP -- Set size of job ; (Code 141, Channel 0) ; ; MEMTOP area, addres ; ; MEMTOP sets the high address of a job under TSX-Plus. On return, R0 ; contains the highest address actually allocated for use by the job. ; This may be lower than the value actually requested if the requested ; value exceeds the maximum allowed job size. Note that the RT-11 ; .SETTOP EMT does not affect job size under TSX-Plus. ; ; area is the address of a two-word EMT argument block ; ; addres is the requested high address for the job ; ; ; Format: R0 => .byte 0,141 ; .word addres ; ; ; Errors: ; ; None documentated .MACRO MEMTOP AREA,ADDRES .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,141 TSXCM ,,LAST .ENDM .sbttl MNTLD -- Mount a logical disk ; (Code 163) ; ; MNTLD area, chan, ldunit, roflag, filnam ; ; MNTLD mounts a specified logical disk file on a specified logical ; disk unit. ; ; area is the address of a three-word EMT argument block ; ; chan number of an unused I/O channel; used during LD ; processing, closed on return ; ; ldunit number of LD unit to be mounted ; ; roflag read-only flag; if 0, read/write access, if 1, ; read-only ; ; filnam address of four-word buffer containing RAD50 ; device/file specification of logical disk file to be ; mounted ; ; ; Format: R0 => .byte chan, 163 ; .byte ldunit, roflag ; .word filnam ; ; ; Errors: ; ; 0 Channel is in use ; 1 Invalid logical disk unit number ; 2 Logical disk support not available ; 3 Logical disk unit already in use ; 4 Invalid file specification ; 5 Invalid logical disk unit number nesting ; 6 Unable to open specified file .MACRO MNTLD AREA,CHAN,LDUNIT,ROFLAG,FILNAM .IIF NDF TSXCV0 .MCALL TSXCM1 TSXCM1 ,163, TSXCMB TSXCMB ,3 TSXCM ,4,LAST .ENDM .sbttl MONJOB -- Start monitoring job status ; (Code 157, Channel 0) ; ; MONJOB area, job, cmprtn ; ; MONJOB initates monitoring on a specific job. If a job number of ; zero is specified, all jobs are monitored. See the TSX-Plus ; documentation for details on job status completion routine entry and ; job status reporting. ; ; area is the address of a three-word EMT argument block ; ; job number of the job to monitor (0 implies all jobs) ; ; cmprtn address of the entry point of a completion routine to ; be entered when a monitor status report is triggered ; ; ; Format: R0 => .byte 0,157 ; .word job ; .word cmprtn ; ; ; Errors: ; ; 1 Invalid job number ; 2 No free job monitoring control blocks ; (MAXMON exceeded) .MACRO MONJOB AREA,JOB,CMPRTN .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,157 TSXCM TSXCM ,4,LAST .ENDM .sbttl MOUNT -- Mount a file structure ; (Code 134, Channel 0) ; ; MOUNT area, device ; ; MOUNT is the equivalent of the "MOUNT device" command. (But not the ; same as the MOUNT command used to mount logical devices.) It tells ; TSX-Plus to mount a file structure and enable directory caching for ; it. ; ; area is the address of a three-word EMT argument block ; ; device is the address of a word containing the RAD50 name of ; the device on which the file structure is being ; mounted ; ; ; Format: R0 => .byte 0,134 ; .word device ; .word 0 ; ; ; Errors: ; ; 1 No room in MOUNT table .MACRO MOUNT AREA,DEVICE .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,134 TSXCM TSXCM #0,4,LAST .ENDM .sbttl MSGCPL -- Queue message receipt completion routine ; (Code 106, Channel 1) ; ; MSGCPL area, chname, mesage, msgsiz, cmprtn ; ; MSGCPL schedules a completion routine to be entered when a message ; is received on a named channel. On entry to the completion routine, ; R0 contains the received message length, R1 contains the number of ; the job that sent the message. The message is truncated if it is too ; long for the message buffer. MESSAGE privilege is required. ; ; area is the address of a five-word EMT argument block ; ; chname address of six-byte ASCII message channel name ; ; mesage address of beginning of job's message buffer ; ; msgsiz length of job's message buffer, in bytes ; ; cmprtn address of completion routine to be entered when ; message received ; ; ; Format: R0 => .byte 1,106 ; .word chname ; .word mesage ; .word msgsiz ; .word cmprtn ; ; ; Errors: ; ; 0 Insufficient privilege (MESSAGE required) or no ; message channel support on system ; 1 All message channels busy ; 4 Message longer than receiving buffer; truncated to ; buffer length ; 5 Maximum number of message requests pending .MACRO MSGCPL AREA,CHNAME,MESAGE,MSGSIZ,CMPRTN .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,106,1 TSXCM TSXCM ,4 TSXCM ,6 TSXCM ,10,LAST .ENDM .sbttl NOMONJ -- Stop monitoring job status ; (Code 157, Channel 1) ; ; NOMONJ area, job ; ; NOMONJ terminates monitoring of a specific job. If a job number of ; zero is specified, all job monitoring connections are cancelled. ; ; area is the address of a two-word EMT argument block ; ; job number of the job to cease monitoring (0 kills all job ; monitoring) ; ; ; Format: R0 => .byte 1,157 ; .word job ; ; ; Errors: ; ; 1 Invalid job number .MACRO NOMONJ AREA,JOB .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,157,1 TSXCM ,,LAST .ENDM .sbttl NONINT -- Set [non]interactive job status ; (Code 153, Channel 0) ; ; NONINT area, mode ; ; NONINT is used to ask TSX-Plus to schedule a running job as either ; interactive or non-interactive. See the TSX-Plus documentation for ; the implications of these two modes. ; ; area is the address of a three-word EMT argument block ; ; mode scheduling mode for job: ; 0 -- non-interactive ; 1 -- normal scheduling ; ; ; Format: R0 => .byte 0,153 ; .word mode ; .word 0 ; ; ; Errors: ; ; None documented .MACRO NONINT AREA,MODE .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,153 TSXCM TSXCM #0,4,LAST .ENDM .sbttl PEEKIO -- Peek into the I/O page ; (Code 140, Channel 1) ; ; PEEKIO area, addres ; ; PEEKIO is used to retrieve the contents of a word in the I/O page ; without the necessity of the program actually mapping to the I/O ; page. The contents of the specified word are reurned in R0. ; ; area is the address of a two-word EMT argument block ; ; addres is the address of the word to be accessed ; ; ; Format: R0 => .byte 1,140 ; .word addres ; ; ; Errors: ; ; 0 Job has insufficient privilege (MEMMAP required) ; ; Program will abort with "Kernel mode trap" error if invalid ; address specified .MACRO PEEKIO AREA,ADDRES .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,1 TSXCM ,,LAST .ENDM .sbttl PHYADD -- Convert virtual to physical address, I-space ; (Code 140, Channel 0) ; ; PHYADD area, viradr, resbuf ; ; PHYADD is used to convert a 16-bit program virtual address to its ; 22-bit physical address. If separate I- and D-space is enabled, ; PHYADD returns the I-space value. ; ; area is the address of a three-word EMT argument block ; ; viradr is the 16-bit virtual address to be converted ; ; resbuf is a pointer to a two-word result buffer; first word ; will contain low-order 16 bits of physical address, ; remaining 6 high-order bits stored in bit positions ; 4 - 9 of second word ; ; ; Format: R0 => .byte 0,140 ; .word viradr ; .word resbuf ; ; ; Errors: ; ; 0 Job has insufficient privilege .MACRO PHYADD AREA,VIRADR,RESBUF .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140 TSXCM TSXCM ,4,LAST .ENDM .sbttl PHYDAD -- Convert virtual to physical address, D-space *6.4* ; (Code 140, Channel 22) ; ; PHYDAD area, viradr, resbuf ; ; PHYDAD is used to convert a 16-bit program virtual address to its ; 22-bit physical address. If separate I- and D-space is enabled, ; PHYADD returns the D-space value. ; ; area is the address of a three-word EMT argument block ; ; viradr is the 16-bit virtual address to be converted ; ; resbuf is a pointer to a two-word result buffer; first word ; will contain low-order 16 bits of physical address, ; remaining 6 high-order bits stored in bit positions ; 4 - 9 of second word ; ; ; Format: R0 => .byte 22,140 ; .word viradr ; .word resbuf ; ; ; Errors: ; ; 0 Job has insufficient privilege .MACRO PHYDAD AREA,VIRADR,RESBUF .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,22 TSXCM TSXCM ,4,LAST .ENDM .sbttl POKEIO -- Poke into the I/O page ; (Code 140, Channel 2) ; ; POKEIO area, addres, value ; ; POKEIO is used to deposit a word value at a specified location in ; the I/O page without the necessity of the program actually mapping ; to the I/O page. ; ; area is the address of a three-word EMT argument block ; ; addres is the address of the word to be accessed ; ; value is the value to be deposited at the specified word ; address ; ; ; Format: R0 => .byte 2,140 ; .word addres ; .word value ; ; ; Errors: ; ; 0 Calling program has insufficient privilege ; (MEMMAP required) ; ; Program will abort with "Kernel mode trap" error if invalid ; address specified .MACRO POKEIO AREA,ADDRES,VALUE .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,2 TSXCM TSXCM ,4,LAST .ENDM .sbttl PRTWIN -- Print window contents (via WINPRT) ; (Code 161, Channel 5) ; ; PRTWIN area, winid ; ; PRTWIN prints a specified window via the WINPRT program. ; ; area is the address of a three-word EMT argument block ; ; winid window identification number (1-26) of window to print ; ; ; Format: R0 => .byte 5,161 ; .byte winid, 0 ; .word 0 ; ; ; Errors: ; ; 0 Window management not available or invalid EMT ; argument block ; 3 Unable to locate specified window ; 4 WINPRT not running .MACRO PRTWIN AREA,WINID .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,161,5 TSXCMB TSXCMB #0,3 TSXCM #0,4,LAST .ENDM .sbttl PRVDEF -- Define privilege flag symbols *Utility Macro* ; (Utility Macro) ; ; PRVDEF (no arguments) ; ; PRVDEF can be called to define a standard set of symbols for the ; TSX-Plus privilege word flag bits. These definitions are handy to ; have when you are manipulating job privileges (GSJPRV request). The ; following table shows and describes the definitions made by PRVDEF. ; ; Privilege word 1 flags: ; ; Symbol Flag Name Access Action ; ------ ---- ---- ------------- ; p.sysp =: 000001 SYSPRV System privilege ; p.nfsw =: 000002 NFSWRITE Non-file-structured read/write access ; p.nfsr =: 000004 NFSREAD Non-file-structured read-onlyaccess ; p.setp =: 000010 SETPRV Affect own privileges ; p.setn =: 000020 SETNAME Change user name or password ; p.send =: 000040 SEND Send messages between jobs ; p.real =: 000100 REALTIME Real-time EMTs ; p.pswa =: 000200 PSWAPM Change process swap mode ; p.oper =: 000400 OPER Operator privilege ; p.bypa =: 001000 BYPASS Bypass device/file access restrictions ; p.memm =: 002000 MEMMAP Access system-significant memory ; p.spfu =: 004000 SPFUN Use .SPFUNs for directory devices ; p.deta =: 010000 DETACH Affect detached jobs ; p.debu =: 020000 DEBUG Use debugging facilities ; p.allo =: 040000 ALLOCATE Allocate a device ; 100000 (unused/reserved) ; ; Privilege word 2 flags: ; ; Symbol Flag Name Access Action ; ------ ---- ---- ------------- ; p.up1 =: 000001 UP1 User-defined privilege 1 ; p.up2 =: 000002 UP2 User-defined privilege 2 ; p.up3 =: 000004 UP3 User-defined privilege 3 ; p.up4 =: 000010 UP4 User-defined privilege 4 ; 000020 (unused/reserved) ; 000040 (unused/reserved) ; 000100 (unused/reserved) ; p.getc =: 000200 GETCXT Get another job's file context ; p.sysg =: 000400 SYSGBL Use named global regions ; p.rloc =: 001000 RLOCK Shared file record locking ; p.mess =: 002000 MESSAGE Use named message channels ; p.subp =: 004000 SUBPROCESS Use subprocesses ; p.same =: 010000 SAME Affect jobs with same PPN ; p.grou =: 020000 GROUP Affect jobs with same project number ; p.worl =: 040000 WORLD Affect any job ; p.term =: 100000 TERMINAL Use terminal and CL commands/EMTs .MACRO PRVDEF P.SYSP =: ^o000001 P.NFSW =: ^o000002 P.NFSR =: ^o000004 P.SETP =: ^o000010 P.SETN =: ^o000020 P.SEND =: ^o000040 P.REAL =: ^o000100 P.PSWA =: ^o000200 P.OPER =: ^o000400 P.BYPA =: ^o001000 P.MEMM =: ^o002000 P.SPFU =: ^o004000 P.DETA =: ^o010000 P.DEBU =: ^o020000 P.ALLO =: ^o040000 P.UP1 =: ^o000001 P.UP2 =: ^o000002 P.UP3 =: ^o000004 P.UP4 =: ^o000010 P.GETC =: ^o000200 P.SYSG =: ^o000400 P.RLOC =: ^o001000 P.MESS =: ^o002000 P.SUBP =: ^o004000 P.SAME =: ^o010000 P.GROU =: ^o020000 P.WORL =: ^o040000 P.TERM =: ^o100000 .ENDM .sbttl REGGBL -- Set up a global PLAS region for fast mapping *6.4* ; (Code 143, Channel 6) ; ; REGGBL area, winid, regidx, regid ; ; REGGBL sets up an existing named global PLAS region for subsequent ; fast mapping to a job. ; ; area is the address of a three-word EMT argument block. ; ; winid the window ID number returned by the .CRAW request ; ; regidx a region index, in the range 0 - 39, for subsequent ; identification of the region during mapping ; ; regid the region ID number returned by the .CRRG request ; ; ; Format: R0 => .byte 6,143 ; .byte winid, regidx ; .word regid ; ; ; Errors: ; ; 1 Specified window or region not defined ; 2 Invalid region index (must be 0 - 39) ; 3 Invalid window ID (must be 1 - 8) ; 4 Attempt to fast map to swappable PLAS region .MACRO REGGBL AREA,WINID,REGIDX,REGID .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,143,6 TSXCMB TSXCMB ,3 TSXCM ,4,LAST .ENDM .sbttl REGRTS -- Define a shared run-time region for fast mapping ; (Code 143, Channel 2) ; ; REGRTS area, par, offset, size, regidx ; ; REGRTS defines a region within a shared run-time system for ; subsequent fast mapping to a job. ; ; area is the address of a five-word EMT argument block. ; ; par PAR number to use when region is mapped ; ; offset the offset, in 64-byte blocks, from the beginning of ; the run-time system to where mapping is to begin ; ; size the size of the region in 64-byte blocks (V6.4 or ; later: if size exceeds 8 Kb, additional PARs and fast ; map regions are automatically assigned) ; ; regidx a region index, in the range 0 - 39, for subsequent ; identification of the region during mapping ; ; ; Format: R0 => .byte 2,143 ; .word par ; .word offset ; .word size ; .word regidx ; ; ; Errors: ; ; 1 No shared run-time system has been associated with job ; 2 Region index is invalid ; 3 Specified size is greater than 8 Kb (V6.3x only) ; 5 Specified offset is beyond the end of the run-time ; system .MACRO REGRTS AREA,PAR,OFFSET,SIZE,REGIDX .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,143,2 TSXCM TSXCM ,4 TSXCM ,6 TSXCM ,10,LAST .ENDM .sbttl RELVEC -- Release interrupt vector ; (Code 140, Channel 12) ; ; RELVEC area, vector ; ; RELVEC releases the connection between an interrupt vector and an ; interrupt service routine or interrupt completion routine. REALTIME ; privilege is required. Interrupts through the specified vector ; should be disabled prior to executing this request! ; ; area is the address of a two-word EMT argument block ; ; vector is the interrupt vector address ; ; ; Format: R0 => .byte 12,140 ; .word vector ; ; ; Errors: ; ; 0 Insufficient privilege (REALTIME required) .MACRO RELVEC AREA,VECTOR .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,12 TSXCM ,,LAST .ENDM .sbttl RSMWIN -- Resume window processing ; (Code 161, Channel 4) ; ; RSMWIN area ; ; RSMWIN resumes window processing that has previously been suspended ; with a SPNWIN request. ; ; area is the address of a one-word EMT argument block ; ; ; Format: R0 => .byte 4,161 ; ; ; Errors: ; ; None documented .MACRO RSMWIN AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,161,4,LAST .ENDM .sbttl RTTDTR -- Raise DTR for a line ; (Code 154, Channel 2) ; ; RTTDTR area, line ; ; RTTDTR is used to raise the DTR (data terminal ready) signal of a ; time-sharing line. It is equivalent to the KMON command SET TT n ; DTR. TERMINAL privilege is required. ; ; area is the address of a 2-word EMT argument block ; ; line is the line number of the time-sharing line to be ; affected. If the line number is zero, the affected ; line is the line issuing the EMT. ; ; ; Format: R0 => .byte 2,154 ; .word line ; ; ; Errors: ; ; 1 Insufficient privilege (TERMINAL required) ; 2 Invalid line number .MACRO RTTDTR AREA,LINE .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,154,2 TSXCM ,,LAST .ENDM .sbttl RTURNS -- Relinquish exclusive system access ; (Code 140, Channel 15) ; ; RTURNS area ; ; RTURNS relinquishes a job's exclusive system access previously ; granted by the STEALS request. ; ; area is the address of a one-word EMT argument block ; ; ; Format: R0 => .byte 15,140 ; ; ; Errors: ; ; None documented .MACRO RTURNS AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,15,LAST .ENDM .sbttl SAVSHR -- Save shared file status ; (Code 122) ; ; SAVSHR area, chan ; ; SAVSHR is used to save the status of a shared access file. It is ; similar in effect to the standard .SAVESTATUS request. RLOCK ; privilege is required. See the TSX-Plus documentation on shared-file ; record locking for more information. ; ; area is the address of a one-word EMT argument block ; ; chan channel on which shared file is open ; ; ; Format: R0 => .byte chan,122 ; ; ; Errors (none documented, but these are likely): ; ; 0 Insufficient privilege (RLOCK required) or no shared- ; file support ; 1 Channel not open to a shared file .MACRO SAVSHR AREA,CHAN .IIF NDF TSXCV0 .MCALL TSXCM1 TSXCM1 ,122,,LAST .ENDM .sbttl SCHCMP -- Schedule completion routine ; (Code 140, Channel 21) ; ; SCHCMP area, cmprtn, rtpri, r1valu ; ; SCHCMP schedules a completion routine. It is intended for use from ; within an in-line interrupt service routine when it is necessary to ; access system services. ; ; NOTE: According to one of the examples in the documentation, the ; real-time priority value, RTPRI, adds to the system PRIHI value. ; Thus, if PRIHI = 80 and RTPRI = 7, the completion routine will run ; at fixed high priority of 87. ; ; area is the address of a five-word EMT argument block ; ; cmprtn is the address of the completion routine entry point ; ; rtpri real-time priority for the completion routine ; (adds to PRIHI) ; ; r1valu value to be passed to completion routine in R1 ; ; ; Format: R0 => .byte 21,140 ; .word cmprtn ; .word rtpri ; .word r1valu ; .word 0 ; ; ; Errors: ; ; None documented .MACRO SCHCMP AREA,CMPRTN,RTPRI,R1VALU .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,21 TSXCM TSXCM ,4 TSXCM ,6 TSXCM #0,10,LAST .ENDM .sbttl SCLRES -- Reset a CL line *6.4* ; (Code 155, Channel 2) ; ; SCLRES area, unit ; ; SCLRES resets a specified CL line. It is equivalent in action to ; SET CLn RESET. However, the SET command -- as well as it's ; equivalent special function -- can hang under some circumstances; ; SCLRES will not. TERMINAL and BYPASS privilege is required. ; ; area is the address of a two-word EMT argument block ; ; unit is the unit number of the CL line to be reset ; ; ; Format: R0 => .byte 2,155 ; .word unit ; ; ; Errors: ; ; 0 Invalid subfunction (channel) code ; 1 Issuing job lacks TERMINAL privilege ; 2 Invalid CL unit number ; 7 Specified CL unit not assigned to a line ; 8 Issuing job lacks BYPASS privilege .MACRO SCLRES AREA,UNIT .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,155,2 TSXCM ,,LAST .ENDM .sbttl SCLXON -- Reset CL line XOFF status *6.4* ; (Code 155, Channel 1) ; ; SCLXON area, unit ; ; SCLXON resets the XOFF status of a specified CL line. It is ; equivalent in action to SET CLn XON. However, the SET command -- as ; well as it's equivalent special function -- can hang under some ; circumstances; SCLXON will not. TERMINAL and BYPASS privilege is ; required. ; ; area is the address of a two-word EMT argument block ; ; unit is the unit number of the CL line to be reset ; ; ; Format: R0 => .byte 1,155 ; .word unit ; ; ; Errors: ; ; 0 Invalid subfunction (channel) code ; 1 Issuing job lacks TERMINAL privilege ; 2 Invalid CL unit number ; 7 Specified CL unit not assigned to a line ; 8 Issuing job lacks BYPASS privilege .MACRO SCLXON AREA,UNIT .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,155,1 TSXCM ,,LAST .ENDM .sbttl SCTRLO -- Suspend terminal output (emulate Control-O) *6.5* ; (Code 120, Channel 2) ; ; SCTRLO area ; ; SCTRLO emulates the effect of entering a Control-O (^O) character. ; It flushes the output buffer and suppresses any further terminal ; output until either a .RCTRLO (reset Control-O) request is issued by ; the program or a Control-O is typed at the affected terminal. ; ; area is the address of a one-word EMT argument block. ; ; ; Format: R0 => .byte 2,120 ; ; ; Errors: ; ; None .MACRO SCTRLO AREA .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,120,2,LAST .ENDM .sbttl SELOPT -- Set program controlled terminal options ; (Code 152, Channel 0) ; ; SELOPT area, func, arg ; ; SELOPT is used to set the various program controlled terminal ; options. See the TSX-Plus documentation for a complete description. ; In general, these options are specified by a function code ; corresponding to the letters A through Z (101 - 132 octal), ; optionally followed by a second argument. ; ; area is the address of a three-word EMT argument block ; ; func terminal option function code, corresponding to the ; letters A - Z (101 - 132 octal) ; ; arg optional function code argument ; ; ; Format: R0 => .byte 0,152 ; .word func ; .word arg ; ; ; Errors: ; ; 1 Invalid terminal option function code .MACRO SELOPT AREA,FUNC,ARG .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,152 TSXCM TSXCM ,4,LAST .ENDM .sbttl SELWIN -- Select current process window ; (Code 161, Channel 1) ; ; SELWIN area, winid ; ; SELWIN selects (switches to) a specified process window. A window ; ID of zero disables windowing for the job, but allows window ; reselection at a later time. ; ; area is the address of a three-word EMT argument block ; ; winid window identification number (1 - 26); ; 0 disables windowing ; ; ; Format: R0 => .byte 1,161 ; .byte winid, 0 ; .word 0 ; ; ; Errors: ; ; 0 Window management not available or invalid EMT ; argument block ; 3 Unable to locate specified window .MACRO SELWIN AREA,WINID .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,161,1 TSXCMB TSXCMB #0,3 TSXCM #0,4,LAST .ENDM .sbttl SEND -- Send message to a line; no wait for buffer ; (Code 127, Channel 2) ; ; SEND area, line, msgadr ; ; SEND displays a message on another line's terminal. This EMT ; returns an error if no free message buffers are available. The ; maximum message length is 88 bytes. ; ; NOTE: The TSX-Plus documentation decribes a single SEND EMT. TSXMAC ; breaks this up into four distinct requests: SEND, SENDW, YELL ; and YELLW. ; ; area is the address of a three-word EMT argument block ; ; line is the number of the line to which the message is to ; be sent. ; ; msgadr is the address of the message text (ASCIZ format). ; ; ; Format: R0 => .byte 2,127 ; .word line ; .word msgadr ; ; ; Errors: ; ; 0 Job does not have SEND privilege ; 1 Target line has SET TT GAG and is executing a program ; 2 No free message buffers are available .MACRO SEND AREA,LINE,MSGADR .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,127,2 TSXCM TSXCM ,4,LAST .ENDM .sbttl SENDW -- Send message to a line; wait for buffer ; (Code 127, Channel 0) ; ; SENDW area, line, msgadr ; ; SENDW displays a message on another line's terminal. This EMT will ; wait until a free message buffer is available before sending the ; message. The maximum message length is 88 bytes. ; ; NOTE: The TSX-Plus documentation decribes a single SEND EMT. TSXMAC ; breaks this up into four distinct requests: SEND, SENDW, YELL ; and YELLW. ; ; area is the address of a three-word EMT argument block ; ; line is the number of the line to which the message is to ; be sent. ; ; msgadr is the address of the message text (ASCIZ format). ; ; ; Format: R0 => .byte 0,127 ; .word line ; .word msgadr ; ; ; Errors: ; ; 0 Job does not have SEND privilege ; 1 Target line has SET TT GAG and is executing a program .MACRO SENDW AREA,LINE,MSGADR .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,127 TSXCM TSXCM ,4,LAST .ENDM .sbttl SETPRI -- Set user mode priority level ; (Code 140, Channel 16) ; ; SETPRI area, prilvl ; ; SETPRI allows a job to set the processor user mode priority level. ; Set the priority level to 7 to block interrupts, 0 to re-enable ; them. Priority 7 should only be used for short periods of time while ; doing time critical code. The default is PRILVL = #0. ; ; area is the address of a two-word EMT argument block ; ; prilvl is the priority level (7 to block interrupts, 0 to re- ; enable them) ; default: PRILVL = #0 ; ; ; Format: R0 => .byte 16,140 ; .word prilvl ; ; ; Errors: ; ; 0 Insufficient privilege (REALTIME required) .MACRO SETPRI AREA,PRILVL=#0 .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,140,16 TSXCM ,,LAST .ENDM .sbttl SETSIZ -- Set program allocation space *Utility Macro* ; (Utility Macro) ; ; SETSIZ [top] ; or ; SETSIZ [top], extra ; or ; SETSIZ ,,total ; ; SETSIZ is used to place a value in a program's block 0 that ; determines the initial amount of memory given to the program when it ; is run under TSX-Plus. Essentially, the SETSIZ macro does the same ; thing as the SETSIZ utility program. However, the macro version ; causes the allocation space value to be set up when the program is ; built, whereas the utility program applies a patch to the program's ; disk image. In either case, the actual allocation space value is ; specified in units of 1024 words (Kwords). (E.g., a value of 4 ; implies an intial program memory allocation of 4096 words.) ; ; The SETSIZ macro arguments are defined as follows: ; ; top is the desired top address of the program. If TOP is ; left blank, and TOTAL is not specified, then TOP is ; assumed to be the value of the current location ; counter. SETSIZ rounds up to the next Kword boundary ; when it calculates the allocation space value. ; ; extra is a value, in Kwords, to add to the number of Kwords ; derived from TOP. When EXTRA is specified, the total ; program allocation space will be: ; (TOP in Kwords) + EXTRA ; EXTRA is analogous to the SETSIZ program's /D:n ; switch. ; default: EXTRA = 0 ; ; total is the program's total allocation space in Kwords. ; TOTAL is analogous to the SETSIZ program's /T:n ; switch. ; default: TOTAL = 0 ; ; The following are the legal formats for calling SETSIZ; anything ; else causes an assembly error: ; ; SETSIZ SETSIZ assumes the current location counter is ; SETSIZ ,extra the top of the program. EXTRA, if present, is ; SETSIZ extra=n the number of Kwords added to the program's ; base allocation size. ; ; SETSIZ top SETSIZ assumes TOP is the desired program high ; SETSIZ top, extra address. EXTRA, if present, is the number of ; SETSIZ top, extra=n Kwords added to the program allocation size ; established by TOP. ; ; SETSIZ ,,total SETSIZ assumes TOTAL is the desired total ; SETSIZ total=n program allocation size in Kwords. .MACRO SETSIZ TOP,EXTRA=0,TOTAL=0 .IF NB .IIF NE .ERROR; ?TSXMAC-W-Argument value "'TOTAL'" ignored ; .SAVE .ASECT .=^O56 .WORD 'EXTRA'+<<'TOP'+^O3776>/^O4000> .RESTORE .MEXIT .ENDC .IF B .IF EQ .SETSIZ=. .SAVE .ASECT .=^O56 .WORD 'EXTRA'+<<.SETSIZ+^O3776>/^O4000> .RESTORE .IFF .IIF NE .ERROR; ?TSXMAC-W-Argument value "'EXTRA'" ignored ; .SAVE .ASECT .=^O56 .WORD TOTAL .RESTORE .ENDC .ENDC .ENDM .sbttl SETTTO -- Set terminal read time-out ; (Code 117, Channel 0) ; ; SETTTO area, timout, actchr ; ; SETTTO sets a terminal read time-out for the next input operation. ; It sets the maximum length of time that can occur between the time ; that a read request is issued to the terminal and the time that the ; input field is terminated with an activation character. ; ; area is the address of a three-word EMT argument block. ; ; timout is the time-out value in 0.5 second units. ; ; actchr is the activation character that will terminate the ; input field if terminal input times out. ; ; ; Format: R0 => .byte 0,117 ; .word timout ; .word actchr ; ; ; Errors: ; ; None documented .MACRO SETTTO AREA,TIMOUT,ACTCHR .IIF NDF TSXCV0 .MCALL TSXCM0 TSXCM0 ,117 TSXCM TSXCM ,4,LAST .ENDM .sbttl SFTIM -- Set file creation time ; (Code 146) ; ; SFTIM area, chan, dblk, time ; ; SFTIM is used to set or change the file creation time for a ; specified file. ; ; area is the address of a three-word EMT argument block ; ; chan an I/O channel number not currently in use ; ; dblk address of a four-word data block containing the RAD50 ; file specification ; ; time file creation time in three-second units past midnight ; ; ; Format: R0 => .byte chan,146 ; .word dblk ; .word time ; ; ; Errors: ; ; 0 Channel currently in use ; 1 Unable to find file ; 2 Device not file structured .MACRO SFTIM AREA,CHAN,DBLK,TIME .IIF NDF TSXCV0 .MCALL TSXCM1 TSXCM1 ,146, TSXCM TSXCM