TIME_PROMPT - Set DCL prompt to current time 24-JUL-1991 18:48:41 VAX MACRO T5.2V-4 Page 1 X01-00 24-JUL-1991 18:34:22 [000000.UT.TP]TIME_PROMPT.MAR;1 (1) 0000 1 .TITLE TIME_PROMPT - Set DCL prompt to current time 0000 2 .IDENT /X01-00/ 0000 3 0000 4 ;++ 0000 5 ; Copyright © 1990 James F. Duff 0000 6 ; 0000 7 ; This program is free software; you can redistribute it and/or modify 0000 8 ; it under the terms of the GNU General Public License as published by 0000 9 ; the Free Software Foundation; either version 1, or (at your option) 0000 10 ; any later version. 0000 11 ; 0000 12 ; This program is distributed in the hope that it will be useful, 0000 13 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 0000 14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0000 15 ; GNU General Public License for more details. 0000 16 ; 0000 17 ; You should have received a copy of the GNU General Public License 0000 18 ; along with this program; if not, write to the Free Software 0000 19 ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 0000 20 ; 0000 21 ; The author can be contacted on the Internet at DUFF@DECUS.COM.AU. 0000 22 ;-- 0000 23 0000 24 ;++ 0000 25 ; 0000 26 ; FACILITY: 0000 27 ; 0000 28 ; Silly buggers 0000 29 ; 0000 30 ; ABSTRACT: 0000 31 ; 0000 32 ; This program loads code into P1 space that sets the DCL 0000 33 ; prompt to the current time, and executes it as an AST. The code 0000 34 ; in P1 space resets the AST to execute every minute. 0000 35 ; 0000 36 ; ENVIRONMENT: 0000 37 ; 0000 38 ; User, executive and kernal modes 0000 39 ; 0000 40 ; AUTHOR: 0000 41 ; 0000 42 ; James F. Duff, 31-Oct-1990 0000 43 ; 0000 44 ; MODIFIED BY: 0000 45 ; 0000 46 ; X01-00 Jim Duff 31-Oct-1990 0000 47 ; Original version of module 0000 48 ; 0000 49 ;-- 0000 50 .LINK "SYS$SYSTEM:SYS.STB"/SELECTIVE_SEARCH 0000 51 00000000 52 .PSECT DATA 00000004 0000 53 ARGS: .BLKL 1 0004 54 00000000 55 .PSECT CODE NOWRT,EXE,SHR 0000 56 0000 0000 57 .ENTRY TP,^M<> TIME_PROMPT - Set DCL prompt to current time 24-JUL-1991 18:48:41 VAX MACRO T5.2V-4 Page 2 X01-00 24-JUL-1991 18:34:22 [000000.UT.TP]TIME_PROMPT.MAR;1 (1) 0002 58 $CMKRNL_S - ; Get to kernal to load our code 0002 59 ROUTIN=LOAD_EXEC 17 50 E9 0011 60 BLBC R0,10$ ; Error ? 0014 61 $CMEXEC_S - ; Declare an executive mode ast 0014 62 ROUTIN=FIRST_TIME 05 50 E9 0023 63 BLBC R0,10$ ; Error ? 50 0000'8F 3C 0026 64 MOVZWL #SS$_NORMAL,R0 ; Indicate normal completion 04 002B 65 10$: RET ; Return to caller 002C 66 007C 002C 67 .ENTRY LOAD_EXEC,^M 00000000'EF D5 002E 68 TSTL CTL$GL_SITESPEC ; Test site specific longword. 0034 69 ; Used to hold addr of code if 0034 70 ; it has already been loaded 1C 13 0034 71 BEQL 10$ ; Branch if zero 00000000'EF 00000000'EF D0 0036 72 MOVL CTL$GL_SITESPEC,ARGS ; Just get addr of code 0041 73 $CANTIM_S - ; Cancel outstanding timer 0041 74 REQIDT=#1777 ; using this timer id 28 11 0050 75 BRB 20$ ; Branch to exit 0052 76 51 0000008C'8F D0 0052 77 10$: MOVL #TP_EXEC_LEN,R1 ; Come here to load code for 0059 78 ; 1st time. Length of code to R1 00000000'GF 16 0059 79 JSB G^EXE$ALOP1IMAG ; Get a block of P1 space 00000000'EF 52 D0 005F 80 MOVL R2,ARGS ; Addr of block to args 00000000'EF 52 D0 0066 81 MOVL R2,CTL$GL_SITESPEC ; Addr to site spec longword 56 00000000'EF 9E 006D 82 MOVAB TP_EXEC,R6 ; Addr of our code to R6 62 66 008C'8F 28 0074 83 MOVC3 #TP_EXEC_LEN,(R6),(R2) ; Copy our code to P1 space 50 0000'8F 3C 007A 84 20$: MOVZWL #SS$_NORMAL,R0 ; Indicate success 04 007F 85 RET ; Return to user mode 0080 86 0000 0080 87 .ENTRY FIRST_TIME,^M<> 52 00000000'EF D0 0082 88 MOVL ARGS,R2 ; Addr of our code to R2 0089 89 $DCLAST_S - ; Execute our code as an AST 0089 90 ASTADR=(R2) 50 0000'8F 3C 0094 91 MOVZWL #SS$_NORMAL,R0 ; Indicate normal completion 04 0099 92 RET ; Return to user mode 009A 93 00000000 94 .PSECT LD$CODE NOWRT,EXE,REL,PIC,LCL 0FFC 0000 95 .ENTRY TP_EXEC,^M 0002 96 00000000 0002 97 TIME = 0 00000008 0002 98 ATIME_D = 8 00000010 0002 99 FAOSTR_D = 16 00000018 0002 100 PROMPT_D = 24 00000020 0002 101 ATIME = 32 00000024 0002 102 FAOSTR = 36 0000002E 0002 103 PROMPT = 46 0002 104 5E 3C C2 0002 105 SUBL #60,SP ; Reserve space on stack 57 5E D0 0005 106 MOVL SP,R7 ; Point to stack with R7 0008 107 18 A7 07 D0 0008 108 MOVL #7,PROMPT_D(R7) ; Length of prompt to desc 1C A7 2E A7 9E 000C 109 MOVAB PROMPT(R7),PROMPT_D+4(R7) ; Address of string to desc 0011 110 10 A7 0A D0 0011 111 MOVL #10,FAOSTR_D(R7) ; Length of CTRSTR to desc 14 A7 24 A7 9E 0015 112 MOVAB FAOSTR(R7),FAOSTR_D+4(R7) ; Addr fix 001A 113 24 A7 213C3521 8F D0 001A 114 MOVL #^A/!5/,FAOSTR+4(R7) ; Next bit 2C A7 20BB 8F B0 002A 116 MOVW #^A/» /,FAOSTR+8(R7) ; Last bit 0030 117 0030 118 $FAO_S CTRSTR=FAOSTR_D(R7), - ; Format the prompt 0030 119 OUTLEN=PROMPT_D(R7), - 0030 120 OUTBUF=PROMPT_D(R7), - 0030 121 P1=#0 ; Current time 0042 122 56 00000000'9F DE 0042 123 MOVAL @#CTL$AG_CLIDATA,R6 ; CLI data area addr to R6 0274 C6 2E A7 07 28 0049 124 MOVC3 #7,PROMPT(R7),628(R6) ; Move our prompt to CLI area 0270 C6 0A 90 0050 125 MOVB #10,624(R6) ; Indicate prompt length 0055 126 08 A7 04 D0 0055 127 MOVL #4,ATIME_D(R7) ; Length of delta time to desc 0C A7 20 A7 9E 0059 128 MOVAB ATIME(R7),ATIME_D+4(R7) ; Addr fix 20 A7 313A2030 8F D0 005E 129 MOVL #^A/0 :1/,ATIME(R7) ; 1 minute delta time 0066 130 0066 131 $BINTIM_S - ; Convert to binary time 0066 132 TIMBUF=ATIME_D(R7), - 0066 133 TIMADR=TIME(R7) 0072 134 56 8B AF 9E 0072 135 MOVAB TP_EXEC,R6 ; Point to our code 0076 136 $SETIMR_S - ; Set a 1 minute timer 0076 137 DAYTIM=TIME(R7), - 0076 138 ASTADR=(R6), - ; To execute us again 0076 139 REQIDT=#1777 ; Use a timer id so we can 008B 140 ; cancel it if they execute this 008B 141 ; again. 008B 142 04 008B 143 RET ; Return to caller 008C 144 0000008C 008C 145 TP_EXEC_LEN = .-TP_EXEC 008C 146 .END TP TIME_PROMPT - Set DCL prompt to current time 24-JUL-1991 18:48:41 VAX MACRO T5.2V-4 Page 4 Symbol table 24-JUL-1991 18:34:22 [000000.UT.TP]TIME_PROMPT.MAR;1 (1) $$$ADR = 00000060 $$T1 = 00000000 $$T2 = 00000004 ARGS 00000000 R 01 ATIME = 00000020 ATIME_D = 00000008 CTL$AG_CLIDATA ******** X 03 CTL$GL_SITESPEC ******** X 02 EXE$ALOP1IMAG ******** X 02 FAOSTR = 00000024 FAOSTR_D = 00000010 FIRST_TIME 00000080 RG 02 LOAD_EXEC 0000002C RG 02 PROMPT = 0000002E PROMPT_D = 00000018 SS$_NORMAL ******** X 02 SYS$BINTIM ******** GX 03 SYS$CANTIM ******** GX 02 SYS$CMEXEC ******** GX 02 SYS$CMKRNL ******** GX 02 SYS$DCLAST ******** GX 02 SYS$FAO ******** GX 03 SYS$SETIMR ******** GX 03 TIME = 00000000 TP 00000000 RG 02 TP_EXEC 00000000 RG 03 TP_EXEC_LEN = 0000008C +----------------+ ! Psect synopsis ! +----------------+ PSECT name Allocation PSECT No. Attributes ---------- ---------- --------- ---------- . ABS . 00000000 ( 0.) 00 ( 0.) NOPIC USR CON ABS LCL NOSHR NOEXE NORD NOWRT NOVEC BYTE DATA 00000004 ( 4.) 01 ( 1.) NOPIC USR CON REL LCL NOSHR EXE RD WRT NOVEC BYTE CODE 0000009A ( 154.) 02 ( 2.) NOPIC USR CON REL LCL SHR EXE RD NOWRT NOVEC BYTE LD$CODE 0000008C ( 140.) 03 ( 3.) PIC USR CON REL LCL NOSHR EXE RD NOWRT NOVEC BYTE +------------------------+ ! Performance indicators ! +------------------------+ Phase Page faults CPU Time Elapsed Time ----- ----------- -------- ------------ Initialization 155 00:00:00.31 00:00:01.36 Command processing 858 00:00:00.82 00:00:01.05 Pass 1 222 00:00:02.61 00:00:05.26 Symbol table sort 0 00:00:00.03 00:00:00.03 Pass 2 23 00:00:00.53 00:00:00.75 Symbol table output 1 00:00:00.03 00:00:00.03 Psect synopsis output 2 00:00:00.03 00:00:00.03 Cross-reference output 0 00:00:00.00 00:00:00.00 Assembler run totals 1271 00:00:04.40 00:00:08.61 The working set limit was 2056 pages. 6804 bytes (14 pages) of virtual memory were used to buffer the intermediate code. TIME_PROMPT - Set DCL prompt to current time 24-JUL-1991 18:48:41 VAX MACRO T5.2V-4 Page 5 VAX-11 Macro Run Statistics 24-JUL-1991 18:34:22 [000000.UT.TP]TIME_PROMPT.MAR;1 (1) There were 10 pages of symbol table space allocated to hold 27 non-local and 3 local symbols. 146 source lines were read in Pass 1, producing 29 object records in Pass 2. 11 pages of virtual memory were used to define 10 macros. +--------------------------+ ! Macro library statistics ! +--------------------------+ Macro library name Macros defined ------------------ -------------- SYS$COMMON:[SYSLIB]STARLET.MLB;1 10 112 GETS were required to define 10 macros. There were no errors, warnings or information messages. MACRO/LIST TIME_PROMPT.MAR