.TITLE JOBMSG .IDENT /V3.00/ .ENABL LC .NLIST BEX ;+ ; **-JOBMSG-Write message from FORTRAN to history file. ; ; This routine is called from FORTRAN programs to write a ; message to the history file in a V3 batch job. If the ; program is not running in batch, the message is printed ; at the terminal. ; ; CALL JOBMSG(text) ; ; where "text" in an ASCIZ string less than or equal to 80 ; characters in length. ; ; Steve Thompson ; School of Chemical Engineering ; Olin Hall ; Cornell University ; Ithaca NY 14853 ; ;- .MCALL GLUN$S,QIOW$S JOBMSG::SUB #<6*2>,SP ; Make space on stack for GLUN$ ; buffer MOV SP,R1 ; Remember stack pointer GLUN$S @#.MOLUN,R1 ; Get info. on TI: BCS 30$ ; If CS, ignore call TST (R5)+ ; Any arguments? BEQ 30$ ; If EQ no, ignore call MOV (R5),R0 ; Get message address 10$: TSTB (R0)+ ; Null byte? BNE 10$ ; If NE no, loop DEC R0 ; Point before null byte SUB (R5),R0 ; Calculate message length BEQ 30$ ; If EQ null, so ignore it CMP R0,#80. ; Message too long? BLE 12$ ; If LE no MOV #80.,R0 ; Yes, truncate to 80 characters 12$: MOV #40,R2 ; Set carriage control for TT CMPB (R1),#'V ; Batch job (TI: is VT device)? BNE 20$ ; If NE no MOV #<<200*400>+40>,R2 ; Set carriage control for batch 20$: QIOW$S #IO.WVB,@#.MOLUN,#11.,,,,<(R5),R0,R2> ; Write message 30$: ADD #<6*2>,SP ; Restore stack to entry state RTS PC ; and return .END