.title $print -- Print output for user .ident -010000- .enabl lc ;+ ; Copyright 1981. Duke University. ; ; General permission is hereby granted to copy, but not for ; profit, this program for use on any computer system provided ; that this copyright notice and attribution is retained. ; ; Abstract: $print ; ; This module is used in conjunction with the "print" macro ; to provide a convenient mechanism for the MACRO programmer ; to write output to the terminal. ; ; The $EDMSG service is used to format the message. This is ; described in the "System Library Routines" manual. Typical ; features include the ability to print octal or decimal ; numbers, character strings, and Radix-50 strings. The ; user should consult the $EDMSG documentation for further ; information. ; ; Calling sequence: ; ; (this should never be called directly by the user). ; ; Limitations: ; ; 1. The output will always be written on the terminal. ; There is no way to redirect the output to a file or ; another program; however it is possible to run this ; in batch in which case it will write on the batch log. ; ; 2. This module uses the .MOLUN logical unit number (see ; the Task Builder manual, Appendix D). This usage ; may cause problems if this module is included in a ; Fortran program or if the programmer uses the MOUT$ ; system service. It will work with PL/I or MACRO ; programs which do not use the MOUT$ system service. ; ; Written: 10-Oct-1981, -1.0.0-, Bruce C. Wright ; Modified: ; Verified: 18-Oct-1981, -1.0.0-, Bruce C. Wright ;- .mcall qiow$s,alun$s .enabl lc outbuf: .blkb 100. ; 100. characters for output buffer. .blkw 40. ; 40. arguments allowed. argblk: ; (label at end for reversing arguments). .molun::.word 0 ; Space for Message Output LUN. $print:: mov r0,-(sp) ; Save registers mov r1,-(sp) ; ... mov r2,-(sp) ; ... mov sp,r0 ; Get the address of the argument block. add #14,r0 ; Add in the offset from the stack. mov #argblk,r2 ; Point to argument block. 10$: dec 12(sp) ; Decrement count of number of arguments. blt 20$ ; J if finished with arguments. mov (r0)+,-(r2) ; Move the arguments into the argblk. br 10$ ; And pick up more arguments. 20$: mov #outbuf,r0 ; Point to the output buffer. mov 10(sp),r1 ; Pick up the address of the input string. call $edmsg ; Convert the data to output format. ; alun$s .molun,#"TI,#0 qiow$s #io.wvb,.molun,.molun,,,,<#outbuf,r1,,,,> ; mov (sp)+,r2 ; Recover registers mov (sp)+,r1 ; ... mov (sp)+,r0 ; ... return ; And return to the caller. .end