.TITLE SENDTIME Send time to requesting RSX task .IDENT /900411/ ; ; © 1990 ; G. Michaels Consulting Ltd. ; Edmonton, Alberta, CANADA ; ; This software is the property of G. Michaels Consulting Ltd. ; and may be used and copied freely provided this notice is ; included. ; ; G. Michaels Consulting Ltd. does not warrant that this ; software may be useful for any particular purpose. Users of ; this software do so at their own risk. G. Michaels Consulting ; Ltd. will bear no responsibility for the results of running ; this software. ; ; Description: ; ; This network task is started in response to an RSX task requesting the time. ; It formats the current time in RSX format, sends it over the network, and ; exits. ; ; Modification Log: ; ; Name Date Change Description ; ; R Brown 900411 New. .PAGE ; ; Detailed Description: ; ; This task is an exercise both to programming in MACRO-32 and using Non- ; transparent DECNET. When this task receives the link request, it gets the ; current time and formats it in the 8 word format used by RSX. It then ; REJECTs the link request, but sends the time as "reason for rejection". ; ; Maybe someday we will learn how to do something better than HALT when ; something doesn't work. ; .PAGE .SUBTITLE Read-write Data .PSECT M$DATA,NOEXE,WRT EQVSTR: .BLKB 60 EQVLEN: .BLKW 1 NCB: .WORD 0,^X010E .ADDRESS EQVSTR QIOW: $QIOW ,,IO$_ACCESS!IO$M_ABORT,IOSB,,,,NCB IOSB: .BLKL 2 .SUBTITLE Read-only data .PSECT M$TEXT,NOEXE,NOWRT NETASN: $ASSIGN NETWORK,QIOW+QIOW$_CHAN TRNLNM: $TRNLNM ,TABNAM,NETLNM,,ITMLST NETMBX: .ASCID /NETMBX/ NETWORK:.ASCID /_NET:/ TABNAM: .ASCID /LNM$DCL_LOGICAL/ NETLNM: .ASCID /SYS$NET/ $LNMDEF ITMLST: .WORD 60,LNM$_STRING .ADDRESS EQVSTR,EQVLEN .LONG 0 .PAGE .SUBTITLE Main program .PSECT M$CODE,EXE,NOWRT .ENTRY SENDTIME,^M<> ; ; Assign a channel to the network and associate the mail box with it. ; $ASSIGN_G NETASN BLBC R0,QUIT ; ; Tranlate SYS$NET, which gives us our NCB. ; $TRNLNM_G TRNLNM BLBC R0,QUIT ; ; Now, find the right place in the NCB, and stuff the time in RSX ; format into it. ; MOVL #EQVSTR,R2 ; Get address of NCB MOVZWL EQVLEN,R1 ; Get length of NCB 10$: ; Find "/" CMPB (R2)+,#^A"/" BEQLU 20$ SOBGTR R1,10$ BRB QUIT 20$: TSTW (R2)+ ; skip over link identifier MOVB #16.,(R2)+ ; we will return 16 bytes $NUMTIM_S (R2) ; Convert date/time BLBC R0,QUIT ; Quit on error SUBW2 #1900.,(R2) ; Calc year origin 1900 ADDL #12.,R2 ; Point to hundredths MULW3 (R2),#60.,R0 ; Convert to ticks DIVW3 #100.,R0,(R2)+ MOVW #60.,(R2)+ ; There are 60 ticks / second MOVB #^A/"/,(R2)+ ; Terminate this, just in case SUBW2 #EQVSTR,R2 ; Calc length MOVW R2,NCB ; and insert into descriptor $QIOW_G QIOW ; Reject link connection after ; slipping the current time into ; the Network connect block. BLBC R0,QUIT ; Crash if it didn't work BLBC IOSB,QUIT $EXIT_S ; Exit QUIT: HALT .END SENDTIME