Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-08 - 43,50514/moncal.asc
There are no other files named moncal.asc in the archive.
;
;+
;.title Monitor calls as callable functions
;.flag index
;.figure 10
;.center
; MONITOR CALLS AS CALLABLE FUNCTIONS
;.skip 2
;.center
;Markku  Suni
;.center
;Computing Centre
;.center
;University of Turku
;.center
;SF-20500 TURKU 50
;.skip 3
;.hl 1 INTRODUCTION
;.i 5
;This set of callable >functions and >subroutines has been designed 
;to be used by programs written in higher-level languages to
;get some useful information from the >DECsystem-10 >monitor.
;These programs can be used as functions or subroutines and they can be
;called from programs which conform the standard TOPS10 calling
;conventions. The names of the functions have been chosen to be
;.list
;.le ;mnemonically meaningfull
;.le ;close to the name of the corresponding monitor call
;.le ;such that they conform the FORTRAN name type rules.
;.end list
;In cases where these goals are conflicting, a compromise is made.
;Generally they are INTEGER FUNCTIONs, but some of them (those that
;return more than one value) can or must be called as SUBROUTINEs.
;.index INTEGER FUNCTIONS
;.index SUBROUTINES
;.i 5
;At the university of Turku these functions have been placed in
;FORTRAN library (SYS:FORLIB.REL). This makes it easy for a
;FORTRAN or >PASCAL user to call these routines and have them
;loaded with his program.
;.hl 1 Installation instructions
;.hl 2 Assembly switches
;.i 5
;There are two possible versions of UUOFUN.REL. One can
;generate it as an indexed library (like FORLIB, or instance),  or as a single file,
;in which case all the routines come in the core load as soon as one is needed.
;.index indexed library
;.index single file
;The choice between these two depends on the setting of assembly switch >FTIND.
;If FTIND = 0 the file UUOFUN.MAC assembles as a single file.
;If FTIND _# 0, the file assembles as several modules ready for indexing with >MAKLIB.
;The default value for FTIND = 1.
;.hl 2 TOPS10 Commands
;.i 5
;All you need is the following set of commands:
;.lm 6
;.skip 1
;#.R MACRO
;. ;#*UUOFUN,UUOFUN/c=TTY:,DSK:UUOFUN
;. ;#FTIND==0    ;or 1 just as you like
;. ;#_^Z
;. ;#FTIND==0   ;or 1 just as you like
;. ;#_^Z
;. ;#.R CREF
;. ;#*UUOFUN.LST=UUOFUN.CRF
;. ;#_^C
;. ;#.R RUNOFF
;. ;#*UUOFUN.MAC
;. ;#_^C
;.skip 1
;.lm 0
;.hl 1 definitions and macros
;.index Definitions and Macros
;.hl 2 Assembly switches
;-
	IFNDEF	FTIND, <FTIND==1>
;+
;If separate modules are assembled by setting FTIND _# 0, then
;assembler creates a >UNIVERSAL symbol table with these
;definitions in order to use AC names and macros in every module.
;-
	IFN	FTIND,<
	UNIVERSAL	UUOFPR
>
;.hl 2 AC definitions
;
;.end select
;
	W==0	;work
	A==1
	B==A+1
	C==B+1
	D==C+1
	E==D+1
	F==E+1
	Q==16
	P==17
;&
;.hl 2 Macros
;.hl 3 Macro >ENTER to define entry point
;Uses FTIND to decide, whether separate modules are needed.
;-
	DEFINE ENTER(NAME), <
	IFN	FTIND, <
	SEARCH	UUOFPR
	TITLE	NAME
>
	ENTRY	NAME
NAME:	CAIA		;FOR F40 and F10
	PUSH	P,CEXIT.##
>
;+
;.HL 2 Macro >ENTRE to define entry point for
;functions written inside some module
;-
	DEFINE ENTRE(NAME), <
	ENTRY	NAME
NAME:	CAIA			;FOR F40 AND F10
	PUSH	P,CEXIT.##
>
;+
;.hl 3 Macro >RET to return from routine
;Uses FTIND to decide whether separate modules are needed.
;-
	DEFINE RET, <
	POPJ	P,
	IFG	FTIND, <
	PRGEND
>
>
;+
;.hl 3 Macro >SAVE to save ac's:
;-
	DEFINE	SAVE(NUM), <
	%N==1
	REPEAT NUM,<
	PUSH	P, %N
	%N==%N+1
>
>
;
;+.hl 3 Macro >REST to restore saved ac's:
;-
	DEFINE REST(NUM), <
	%NN==NUM
	REPEAT	NUM, <
	POP	P, %NN
	%NN=%NN-1
>
>
	IFN	FTIND,<
	PRGEND		;END OF UNIVERSAL SYMBOL TABLE
>
;+
;.hl 1 Individual routines
;.skip 2
;.hl 2 Subroutine CDATE
;.index Subroutine CDATE
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To return current date as three integers 
;USAGE	- CALL CDATE( IYEAR, MONTH, IDAY )
;PARAMETERS:
;	IYEAR	- Integer: current year
;	MONTH	- Integer: current month
;	IDAY	- integer: current day of the month
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;.index current date
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	CDATE
	MOVE	A,[XWD 11, 56]	;GETTAB INDEX FOR YEAR
	MOVS	0, A		;GET THE CURRENT YEAR
	GETTAB	0,
		SETZM	0	;IF IT FAILS
	MOVEM	0,@(Q)		;RETURN TO USER
	ADDI	A, 1		;INDEX OF MONTH
	MOVS	0, A		;FOR GETTAB
	GETTAB	0,
		SETZM	0	;IF IT FAILS, JUST ZERO
	MOVEM	0,@1(Q)	;RETURN TO USER
	ADDI	A,1		;INDEX OF CURRENT DAY
	MOVS	0, A
	GETTAB	0,
		SETZM	0
	MOVEM	0,@2(Q)		;RETURN TO USER
	RET
;+
;.hl 2 Function MYPPN
;.index FUNCTION MYPPN
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- to get my project, programmer number 
;USAGE	- I = MYPPN(1)
;PARAMETERS:
;		ignored, but one needed for FORTRAN compiler
;RESULT:
;		User's project number in I left half and
;		User's programmer number in I right half
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER (MYPPN)
	GETPPN	0,	;GET MY PPN
	   TLN	0, 0	;NO-OP
	RET
;+
;.hl 2 Subroutine MYPETP
;.index SUBROUTINE MYPETP
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- to get my project, programmer numbers 
;		  in two separate words
;USAGE	- CALL MYPETP(IROJ, IPROG)
;PARAMETERS:
;		IPROJ: INTEGER, contains the user's project number
;		IPROG: INTEGER, contains the user's programmer 
;		number.  Both are output parameters
;DATE LAST MODIFIED: 05-Jun-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER (MYPETP)
	GETPPN	0,	;GET MY PPN
	   TLN	0, 0	;NO-OP
	HLRZM	0, @(Q)	;GIVE PROJECT NUMBER TO THE USER
	HRRZM	0, @1(Q) ;AND THE PROGRAMMER NUMBER
	RET
;+
;.hl 2 FUNCTION MSTIME
;.index FUNCTION MSTIME
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To give (as result) the current time of
;		day in milliseconds since midnight 
;USAGE	- I = MSTIME(1)
;PARAMETERS:
;		Ignored, one needed for FORTRAN compiler
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER (MSTIME)
	CALLI	0, 23		;MSTIME UUO
	RET
;+
;.hl 2 FUNCTION NOTHER
;.index FUNCTION NOTHER
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To tell the user, whether there are
;		other users logged in under this same ppn
;USAGE	- I = NOTHER(1)
;PARAMETERS:
;		Ignored, needed for FORTRAN compiler
;RESULT:
;		I = 0 ( or FALSE) in case there
;		   are no other users under this ppn
;		I _# 0 (or TRUE) in case there are others
;DATE LAST MODIFIED: 8-FEB-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER (NOTHER)
	OTHUSR	0,		;ARE THERE OTHERS
	   TRZA	0,777777	;NO, SET AC ZER & SKIP
	TRO	0,777777	;YES, SET AC # 0
	TLZ	0,777777	;CLEAR AC LEFT HALF
	RET
;+
;.hl 2 Function JOBNUM
;.index FUNCTION JOBNUM
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To return the user's job number 
;USAGE	- I = JOBNUM(1)
;PARAMETERS:
;		Ignored, but needed for FORTRAN compiler
;RESULT:
;		Job number in I
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER JOBNUM
	PJOB	0,	;GET THE JOB NUMBER
	RET
;+
;.hl 2 Function JOBTIM
;.index FUNCTION JOBTIM
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To return the job's accumulated runtime in
;		 milliseconds 
;USAGE	- I = JOBTIM(1)
;PARAMETERS:
;		Ignored, but needed for FORTRAN compiler
;RESULT:
;		Runtime of your job in milliseconds
;DAT LAST MODIFIED: 8-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER JOBTIM
	SETZM	0	;CLEAR AC, ITS YOUR JOB
	RUNTIM	0,
	RET
;+
;.hl 2 Function JIFFY
;.index FUNCTION JIFFY
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To return time of day in jiffies (20ms) 
;USAGE	- I = JIFFY(1)
;PARAMETERS:
;		Ignored, but needed for FORTRAN compiler
;RESULT
;		Time of day in jiffies, i.e. number of
;		20ms cycles since midnight
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	JIFFY
	TIMER	0,
	RET
;+
;.hl 2 FUNCTION RUN
;.index  FUNCTION RUN
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	-To allow a program to start execution of
;		another (>SAVEd ) program 
;USAGE	- X = RUN( FILE, EXT, PPN)
;PARAMETERS:
;		FILE: name of file to be >RUN (>ASCII variable
;		or constant). Length of NAME is 2 words
;		EXT: extension of the name of the file to be RUN.
;		It can be left zero in which case the monitor
;		searches for file FILE with appropriate
	IFNDEF	FTIND, <FTIND==1>
;		extension.
;		PPN: Project-programmer number of the file
;		to be RUN. May be left zero, in which
;		case monitor searches for FILE on user's own area
	IFNDEF	FTIND, <FTIND==1>
;DATE LAST MODIFIED: 12-MAR-80
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	RUN
	MOVEI	D, 6		;NAME LENGTH
	MOVE	B,[POINT 6,PARMS ] ;POINTER TO SIXBIT NAME
	MOVE	C,[POINT 7, 0 ]	;POINTER T ASCII
	HRRI	C,@(Q)		;ADDR OF NAME IN BYTE POINTER
	PUSHJ	P,MOVEIT	;MOVE NAME TO PARAMETER AREA
;
	SKIPN	A,@1(Q)		;GET EXTENSION, IF ANY
	JRST	PPN		;NO EXTENSION
	MOVEI	D, 3		;LENGTH OF EXT
	MOVE	B,[POINT 6, PARMS+2]
	MOVE	C,[POINT 7, A]
	PUSHJ	P, MOVEIT	;MOVE EXTENSION
;
PPN:	SKIPN	A, @2(Q)	;GET PPN, IF ANY
	MOVEM	A, PPNIN	;STORE TO PARAM. LIST
	HRRI	A, ADDR		;ADDR OF PARM LIST
	CALLI	A, 35		;RUN THE FILE
	   HALT			;IF ERROR, HALT
	JRST 	RETU		;OTHERWISE  RETURN
;
MOVEIT:	ILDB	0, C		;LOAD ASCII BYTE
	SUBI	0, 40		;CONVERT TO SIXBIT
	IDPB	0, B		;DEPOSIT SIXBIT BYT
	SOJG	D, MOVEIT		;GET MORE, IF ANY
	POPJ	P,
;
ADDR:	SIXBIT	?DSK?		;DEVICE IS DSK
PARMS:	BLOCK	2
	EXP	0		;for extension
	EXP	0
PPNIN:	XWD	0,0
	XWD	0,0
RETU:
	RET
;+
;.hl 2 SUBROUTINE MYNAME
;.index SUBROUTINE MYNAME
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To tell the user's name 
;USAGE	- CALL MYNAME( NAME )
;PARAMETERS:
;	NAME: array of length 3 (words) in which the 
;	routine will return the user's name in >ASCII
;	left-justified 5 characters in a word
;	with 12 characters of the name and three blanks
;DATE LAST MODIFIED: 25-May-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	MYNAME
	MOVE	A,(Q)	;ADDR OF NAME IN ACC
	MOVE	0,[ASCII/     /]	;BLANKS TO AC
	MOVEM	0,(A)		;INITIALIZE NAME
	MOVEM	0,1(A)
	MOVEM	0,2(A)
	MOVE	B,[XWD -1, 31]	;GETTAB INDEX FOR NAME
	MOVE	C, B		;FOR TWO HALVES OF NAME
	ADDI	C, 1
	GETTAB	B,		;FIRST 6 CHARS OF NAME
	   JRST	NONAM		;IF IT FAILS, CANT'T HELP
	GETTAB	C,		;THE REST OF THE NAME
	   JRST	NONAM		;HOPE IT WON'T FAIL
	HLL	A,[POINT 7,0 ]	;MAKE ACC A BYTE POINTER
	MOVE	D,[POINT 6,B ]	;MAKE ACC D A BYTE POINTER
	MOVEI	E, 14		;NAME LENGTH
MYNLOP:	ILDB	0, D		;BYTE TO 0 (SIXBIT)
	ADDI	0, 40		;CONVERT TO ASCII
	IDPB	0, A	;STORE TO USER
	SOJG	E, MYNLOP	;GET NEXT CHAR, IF ANY
NONAM:
	RET
;+
;.hl 2 Subroutine DSKINF
;.index SUBROUTINE DSKINF
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To combine the functions of
;		INDSK, NOUDSK, and NDSSEC
;USAGE	- CALL DSKINF( INBLK, NOUBLK, NSECS )
;PARAMETERS:
;	INBLK: Integer, gives the number of disc blocks
;		read so far
;	NOUBLK: Integer, gives the number of disc blocks
;		written so far
;	NSECS: Integer, gives the number of disc block 
;		seconds used so far
;DATE LAST MODIFIED: 25-May-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	DSKINF
	PUSHJ	P, INDSK	;GET THE NUMBER OF READ BLKS
	MOVEM	0, @(Q)		;STORE TO USER
	PUSHJ	P, NOUDSK	;NUMBER OF BLKS WRITTEN
	MOVEM	0, @1(Q)	;TO USER
	PUSHJ	P, NDSSEC	;AND SECONDS
	MOVEM	0, @2(Q)	;TO USER
	POPJ	P,
;+
;.hl 2 Function  INDSK
;.index FUNCTION INDSK
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To tell the user, how many disc blocks
;		 this job has read 
;USAGE	- I = INDSK(1)
;PARAMETERS:
;		Ignored, but needed for FORTRAN compiler
;RESULT:
;	Number of disc bloks read by job so far
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;-
	ENTRE	INDSK
	MOVE	0,[XWD -1, 17]	;GETTAB TABLE INDEX
	GETTAB	0,
	   SETZM	0	;CLEAR AC0, ERROR
	POPJ	P,
;+
;.hl 2 Function NOUDSK
;.index FUNCTION NOUDSK
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To tell the user, how many disc blocks
;		this program has written
;USAGE	- I = NOUDSK(1)
;PARAMETERS:
;		Ignored, but needed for FORTRAN compiler
;RESULT:
;	Number of disc blocks written so far
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;-
	ENTRE	NOUDSK
	MOVE	[XWD -1, 20]	;GETTAB TABLE INDEX
	GETTAB	0,
	   SETZM	0
	POPJ	P,
;+
;.hl 2 Function NDSSEC
;.index FUNCTION NDSSEC
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To tell the user the number of disc
;		 block seconds used 
;USAGE	- I = NDSSEC(1)
;PARAMETERS:
;	Ignored, but needed for FORTRAN compiler
;RESULT:
;	Number of disck block seconds used so far
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;-
	ENTRE	NDSSEC
	MOVE	0,[XWD -1, 21]
	GETTAB	0,
	   SETZM	0
	RET
;+
;.hl 2 Subroutine LOCTIM
;.index SUBROUTINE LOCTIM
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To tell the current local time 
;USAGE	- CALL LOCTIM( LOCHOR, LOCMIN, LOCSEC )
;PARAMETERS:
;	LOCHOR: Integer, contains the local hour
;		in 24-hour format
;	LOCMIN: Integer, contains the local minutes
;	LOCSEC: Integer, contains the local seconds
;DATE LAST MODIFIED: 25-May-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	LOCTIM
	SETZB	0, 1		;CLEAR FOR DIVIDE
	CALLI	0, 23		;GET TIME OF DAY IN MS
;
;	NOW, CONVERT MILLISECONDS TO HOURS, MINUTES AND SECONDS
;
	IDIV	0,[^D3600000]	;TOTAL HOURS IN 0
	MOVEM	0,@(Q)		;GIVE HOURS TO CALLER
	MOVE	0, 1		;GET LEFTOVER MS IN 0
	IDIVI	0, ^D60000	;GET MINUTES IN 0
	MOVEM	0, @1(Q)	;GIVE MINUTES TO USER
	MOVE	0, 1		;GET LEFTOVER MILLISECONDS
	IDIVI	0, ^D1000	;GET SECONDS IN 0
	MOVEM	0, @2(Q)	;GIVE SECONDS TO USER
	RET
;+
;.hl 2 Function LOCHOR
;.index FUNCTION LOCHOR
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To tell the current local hour 
;USAGE	- I = LOCHOR(1)
;PARAMETERS:
;	Ignored, but needed for the FORTRAN compiler
;RESULT:
;	The current local hour in 24-hour format
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;.index 24-hour format
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	LOCHOR
	MOVE	0,[XWD 61, 11]	;GETTAB INDEX FOR HOUR
	GETTAB	0,
	   SETZM	0
	RET
;+
;.hl 2 Function LOCMIN
;.index FUNCTION LOCMIN
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To tell the current local minute 
;USAGE	- I = LOCMIN(1)
;PARAMETERS:
;	Ignored, but needed for FORTRAN compiler
;RESULT:
;	The number of local minutes
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	LOCMIN
	MOVE	0,[XWD 62, 11]
	GETTAB	0,
	   SETZM	0
	RET
;+
;.hl 2 Function LOCSEC
;.index FUNCTION LOCSEC
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To tell the  local seconds 
;USAGE	- I = LOCSEC(1)
;PARAMETERS:
;	Ignored, but needed for FORTRAN compiler
;RESULT:
;	Number of current local seconds
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	LOCSEC
	MOVE	0,[XWD 63, 11]
	GETTAB	0,
	   SETZM	0
	RET
;+
;.hl 2 Function INBATC
;.index FUNCTION  INBATC
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To tell the user, whether this is a BATCH job 
;USAGE	- I = INBATC(1)
;PARAMETERS:
;	Ignored, but needed for the FORTRAN compiler
;RESULT:
;	i = 0 (FALSE) if this is NOT a BATCH job
;	i _# 0 (TRUE) if this is a BATCH job
;DATE LAST MODIFIED: 8-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	INBATC
	MOVE	0, [XWD -1, 40]
	GETTAB	0,		;GET BATCH STATUS
	  SETZM	0
	HLRZ	0, 0		;SHIFT TO RIGHT
	ANDI	0, 000200	;LEAVE ONLY BIT 10
	RET
;+
;.hl 2 SUBROUTINE DEVTYP
;.index SUBROUTINE DEVTYP
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To inform the user about the physical
;		properties of a device 
;USAGE	- CALL DEVTYP(DEV,ISDIR, MINE, ISSPL, KIND)
;PARAMETERS: Integers:
;	DEV: Name of the device in question (ASCII)
;		this is input parameter
;		The rest are output parameters
;	

;	ISDIR: .NE. 0  , if this is a directory device
;	MINE:  .NE.0  if  dev. is available to caller
;	ISSPL: .NE. 0 if this device is spooled
;	KIND:  Device type. One of the following:
;		0 - disk
;		1 - DECtape
;		2 - Magnetic tape
;		3 - Terminal
;		4 - Paper tape reader
;		5 - Paper tape punch
;		6 - display unit
;		7 - Line printer
;		8 - Card reader
;		10 - Pseudo teletype (BATCH job or OPSER)
;		11 - Plotter
ERROR:
;	In case of error, DEV is zeroed and other parameters
;	are left untouched.
;	Error: user specified non-existing or non-initialized
;	device.
;DATE LAST MODIFIED: 24-May-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	DEVTYP
	MOVEI	B, 6		;LENGTH OF NAME OF DEVICE
	MOVE	C,[POINT 6, A]	;SIXBIT STRING ADDRESS
	MOVE	D,[POINT 7, 0]	;ASCII STRING ADDRESS
	HRRI	D,@(Q)		;ADDR OF ASCII STRING
ILDB:	ILDB	0, D		;GET BYTE
	SUBI 	0,40		;CONVERT TO SIXBIT
	IDPB	0, C		;STORE IT
	SOJG	B, ILDB		;CONTINUE
	CALLI	1, 53		;FIND THE PROPERTIES
	   JRST ERRO		;Error in case
	SETZM	0		;CLEAR 0
	LSHC	0, 1		;SHIFT BIT 0 INTO AC 0
	MOVEM	0, @1(Q)	;INFORM USER: DIRECTORY OR NOT
	LSHC	0, 13		;UNINTERESTNING BITS TO AC 0
	SETZM	0		;CLEAR THEM IN  0
	LSHC	0, 1		;SHIFT BIT 12 INTO AC 0
	MOVEM	0, @2(Q)	;INFORM: AVAILABLE OR NOT
	SETZM	0
	LSHC	0, 1		;SHIFT BIT 13 inTO AC 0
	MOVEM	0, @3(Q)	;INFORM: SPOOLED OR NOT
	LSHC	0, 21		;UNINTRESTNING BITS TO AC 0
	SETZM	0
	LSHC	0, 6		;SHIFT BITS 30 - 35 INTO AC 0
	MOVEM	0, @4(Q)	;INFORM: DEVICE TYPE
	SKIPA			;OK, RETURN
ERRO:	SETZM	@(Q)		;CLEAR PARAMETER DEV
	RET
;+
;.hl 2 Function FCLOCK
;.index FUNCTION FCLOCK
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To function as a clock 
;USAGE	- X = FCLOCK(I)
;
;HOW DOES IT WORK:
;	When called for the first time, FCLOCK ignores
;	any parameters. It asks the monitor for the time
;	of day in milliseconds and stores this time.
;	On later calls it asks for the then current time
;	in milliseconds and subtracts this from the time 
;	it is keeping thus giving the amount of time 
;	elapsed since a) the first call, or 
;		b) the call before this
;PARAMETERS:
;	I: Integer. When zero, tells FCLOCK to keep the same
;	time thus counting time from the very first start.
;	When not equal to zero, tells FCLOCK to save 
;	the time of the this call, thus counting time
;	 between successive calls.

;RESULT:
;	The aforementioned time is given in milliseconds
;	and it is a REAL number.
;
;DATE LAST MODIFIED: 9-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	FCLOCK
	MSTIME	0,	;ASK FOR CURRENT TIME
	SKIPE	1, TIME	;IS THIS THE FIRST CALL?
	JRST	NOTINI	;NO, THIS IS NOT
	MOVEM	0, TIME	;FIRST CALL, STORE TIME
	POPJ	P,	;AND RETURN
TIME:	0		;TIME OF DAY IN MS
NOTINI:	SUBM	0, 1	;TIME SINCE TIME IN "TIME"
	SKIPE	0, @(Q)	;DOES THE USER WANT CURRENT TIME
	MOVEM	0, TIME	;YES, SAVE THE CURRENT TIME
	MOVE	0, 1	;GIVE USER THE DIFFERENCE
	PUSHJ	P, FLT.0##	;FLOAT THE NUMBER
	RET
;+
;.hl 2 Function ICLOCK
;.index FUNCTION ICLOCK
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To function as a clock 
;USAGE	- K = ICLOCK(I)
;
;HOW DOES IT WORK:
;	When called for the first time, ICLOCK ignores
;	any parameters. It asks the monitor for the time
;	of day in milliseconds and stores this time.
;	On later calls it asks for the then current time
;	in milliseconds and subtracts this from the time 
;	it is keeping thus giving the amount of time 
;	elapsed since a) the first call, or 
;		b) the call before this
;PARAMETERS:
;	I: Integer. When zero, tells ICLOCK to keep the same
;	time thus counting time from the very first start.
;	When not equal to zero, tells ICLOCK to save 
;	the time of the this call, thus counting time
;	 between successive calls.

;RESULT:
;	The aforementioned time is given is milliseconds
;	as an INTEGER.
;
;DATE LAST MODIFIED: 9-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	ICLOCK
	MSTIME	0,	;ASK FOR CURRENT TIME
	SKIPE	1, TIME	;IS THIS THE FIRST CALL?
	JRST	NOTINI	;NO, THIS IS NOT
	MOVEM	0, TIME	;FIRST CALL, STORE TIME
	POPJ	P,	;AND RETURN
TIME:	0		;TIME OF DAY IN MS
NOTINI:	SUBM	0, 1	;TIME SINCE TIME IN "TIME"
	SKIPE	0, @(Q)	;DOES THE USER WANT CURRENT TIME
	MOVEM	0, TIME	;YES, SAVE THE CURRENT TIME
	MOVE	0, 1	;GIVE USER THE DIFFERENCE
	RET
;+
;.hl 2 Function SWATCH
;.index FUNCTION SWATCH
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To function as a stopwatch 
;USAGE	- X = SWATCH(I)
;
;HOW DOES IT WORK:
;	When called for the first time, SWATCH ignores
;	any parameters. It asks the monitor for the 
;	accumulated runtime of the job and stores this time.
;	On later calls it asks for the so far accumulated 
;	runtime (ms) and subtracts this from the time 
;	it is keeping thus giving the amount of runtime 
;	used since a) the first call, or 
;		b) the call before this
;PARAMETERS:
;	I: Integer. When zero, tells SWATCH to keep the same
;	time thus counting runtime from the very first start.
;	When not equal to zero, tells SWATCH to save 
;	the time of the this call, thus counting runtime
;	 between successive calls.

;RESULT:
;	The aforementioned runtime is given in milliseconds
;	and it is a REAL number.
;
;DATE LAST MODIFIED: 24-May-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	SWATCH
	SETZM	0	;CLEAR AC 0, ITS THIS JOB's TIME
	RUNTIM	0,	;ASK FOR CURRENT TIME
	SKIPE	1, TIME	;IS THIS THE FIRST CALL?
	JRST	NOTINI	;NO, THIS IS NOT
	MOVEM	0, TIME	;FIRST CALL, STORE TIME
	POPJ	P,	;AND RETURN
TIME:	0		;TIME OF DAY IN MS
NOTINI:	SUBM	0, 1	;TIME SINCE TIME IN "TIME"
	SKIPE	0, @(Q)	;DOES THE USER WANT CURRENT TIME
	MOVEM	0, TIME	;YES, SAVE THE CURRENT TIME
	MOVE	0, 1	;GIVE USER THE DIFFERENCE
	PUSHJ	P, FLT.0##	;FLOAT THE NUMBER
	RET
;+
;.hl 2 Function IWATCH
;.index FUNCTION IWATCH
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To function as a stopwatch 
;USAGE	- X = IWATCH(I)
;
;HOW DOES IT WORK:
;	When called for the first time, IWATCH ignores any
;	 parameters. It asks the monitor for the accumulated 
;	runtime of the job and stores this time.
;	On later calls it asks for the so far accumulated 
;	runtime (ms) and subtracts this from the time it is 
;	 keeping thus giving the amount of runtime used 
;	 since a) the first call, or 
;		b) the call before this
;PARAMETERS:
;	I: Integer. When zero, tells IWATCH to keep the same
;	time thus counting runtime from the very first start.
;	When not equal to zero, tells IWATCH to save 
;	the time of the this call, thus counting runtime
;	 between successive calls.

;RESULT:
;	The aforementioned runtime is given in milliseconds
;	and it is an INTEGER number.
;
;DATE LAST MODIFIED: 24-May-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	IWATCH
	SETZM	0	;CLEAR AC 0, ITS THIS JOB's TIME
	RUNTIM	0,	;ASK FOR CURRENT TIME
	SKIPE	1, TIME	;IS THIS THE FIRST CALL?
	JRST	NOTINI	;NO, THIS IS NOT
	MOVEM	0, TIME	;FIRST CALL, STORE TIME
	POPJ	P,	;AND RETURN
TIME:	0		;TIME OF DAY IN MS
NOTINI:	SUBM	0, 1	;TIME SINCE TIME IN "TIME"
	SKIPE	0, @(Q)	;DOES THE USER WANT CURRENT TIME
	MOVEM	0, TIME	;YES, SAVE THE CURRENT TIME
	MOVE	0, 1	;GIVE USER THE DIFFERENCE
	RET
;+
;.hl 2 Function INBIT
;.index function INBIT
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To get some bits from a word 
;USAGE	- I = INBIT( WORD, IFROM, MANY )
;PARAMETERS:
;	WORD	- The word from which th bits will be
;		picked
;	IFROM	- Bit position of the first bit to be picked
;		   (bit 0 is the sign bit, bit 35 the rightmost)
;	MANY	- Number of bits to be picked
;RESULT:
;		The picked bits right justified on I
;DATE LAST MODIFIED: 22-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	INBIT
	MOVE	0,@(Q)	;GET THE WORD
	ASH	0,@1(Q)		;SHIFT THE FIRST BIT TO LEFT
	MOVNI	1,^D35		;NUMBER OF BITS IN WORD
	SUB	1,@2(Q)		;LEAVE THIS MANY AND 
	LSH	0,1		;SHIFT THE REST OUT TO RIGHT
	RET
;+
;.hl 2 Subroutine MOVBIT
;.index Subroutine MOVBIT
;.skip 1
;.nf.nj.tab 5, 10, 15
;PURPOSE	- To move bits within words 
;.index Move bits
;USAGE	- CALL MOVBIT( FROMWR, IBEGIN, MANY, TOWORD, IBEG)
;PARAMETERS:
;	FROMWR: The word from which the bits are to be moved
;	IBEGIN:	The bit position of the first bit to be moved
;	MANY:	This many bits will be moved
;	TOWORD:	The word to which the bits will be moved
;	IBEG:	The bit position of the first bit of the
;		receiving field into which the bits will be moved
;		without modifying any other bits of the word.
;
;WARNING:	In case the parameters give bit positions outside
;		a computer word, the move will not be done and
;		the parameter MANY will be set to zero.
;
;DATE LAST MODIFIED: 23-Feb-79
;.fill.justify
;-
	SEARCH	UUOFPR
	IFNDEF	FTIND, <FTIND==1>
	ENTER	MOVBIT
	MOVE	A,@(Q)		;GET THE "FROM" WORD
	SKIPL	C,@1(Q)		;BIT POSITION OK?
	CAILE	C,^D35		;I MEAN, WITHIN A WORD?
	JRST	ZEROA		;UNFORTUNATELY NO.
	ASH	A,C		;OK. SHIFT THE WANTED BITS LEFT
	SETZM	0
	ASHC	0,@2(Q)		;SHIFT THE BITS WANTED IN AC A
	ADD	C,@2(Q)	;IS THE FIELD WANTED WITHIN A WORD
	SKIPL	D,@2(Q)		;OR IS IT GREATER THAN 0 BITS?
	CAILE	C,^D35		;SHOULD BE LESS THAN 36
	   JRST	ZEROA		;UNFORTUNATELY NO
	MOVE	B,@C(Q)		;"TO" WORD IN AC
	SKIPL	D,@4(Q)		;WHERE IS THE "TO" FIELD?
	CAILE	D,^D35		;IS IT WITHIN THE WORD?
	  JRST	ZEROA		;UNFORTUNATELY NO
	SETZM	A		;CLEAR A
	ASHC	A,D		;LEAVE THE "TO" FIELD IN AC B
	ASH	A,C		;NOW, THE "TO" FIELD IN AC A (ZEROED)
	ASH	B,C		;REST OF THE WORD TO LEFT OF AC B
	OR	0,A		;OR THE BITS IN
	SUBI	C,^D35	;HOW TO GET THE REST OF THE WORD IN AC A?
	ADD	C,D		;CALCULATE LENGTH OF SHIFT
	MOVN	C,C		;AND NEGATE
	ASHC	A,C		;GET THE REST OF THE WORD
	MOVEM	A,@3(Q)		;GIVE IT TO USER
	POPJ	P,		;RETURN TO CALLER
ZEROA:
	SETZM	@2(Q)		;ZERO THE MANY PARAMETER
	POPJ	P,		;RETURN
	PRGEND
;
;+
;.page
;.do index
;-
; [END OF UUOFUN]
;
	END