Errmsg MACRO Y05.04 Tuesday 20-Jan-87 22:34 Page 1 1 .title errmsg 2 .ident /v01/ 3 4 ; Author: 5 ; William L. Kyle 6 ; E.I. duPont de Nemoures & Co. 7 ; Engineering Department 8 ; P.O. Box 6090 9 ; Newark, DE 19714-6090 10 ; 11 ;========================================================================; 12 ; Copyright (C) 1987 ; 13 ; E.I. duPont de Nemoures & Co. ; 14 ; All rights reserved. ; 15 ; This software is furnished through the DECUS Library and may ; 16 ; NOT be sold. It may be copied only with the inclusion of ; 17 ; this copyright notice. ; 18 ; ; 19 ; DuPont assumes no responsibility for the use or reliability ; 20 ; of this software. ; 21 ;========================================================================; 22 .enable lc 23 ; 24 ; calling sequence: 25 ; call errmsg 26 ; r1 - address of message string 27 ; r2 - address of status value stack 28 ; first word = number of arguments 29 ; argument list 30 ; - if r2 odd do not print task name 31 ; r3 - lun 32 ; 33 ; message format: 34 ; msg1: .asciz /%2R -- OPEN error %1P on input file/ 35 ; msg2: .asciz /%2R -- Files: %D, pages: %D, lines: %T/ 36 ; 37 ; output: 38 ; cc - success 39 ; cs - error 40 ; 41 42 .mcall qiow$s,gtsk$s 43 44 ; program sections 45 000000 .psect $code, i, ro, con, rel, lcl 46 000000 .psect $$buf, d, rw, ovr, rel, gbl 47 48 000000 .psect $code 49 ; local equates 50 000015 flag = 13. ; event flag for QIOW 51 52 ; local buffer 53 .save 54 000000 .psect $$buf 55 ; 56 ; NOTE: This buffer can be made larger by declaring the PSECT $$BUF 57 ; with a larger size in the calling program or durring linking Errmsg MACRO Y05.04 Tuesday 20-Jan-87 22:34 Page 1-1 58 ; with an EXTSCT option. 59 ; 60 000000 outbuf: .blkb 80. ; output buffer 61 .even 62 000000 .restore Errmsg MACRO Y05.04 Tuesday 20-Jan-87 22:34 Page 2 64 65 000000 010046 errmsg::mov r0,-(sp) ; save r0 66 000002 010446 mov r4,-(sp) ; save r4 67 000004 010546 mov r5,-(sp) ; save r5 68 000006 005046 clr -(sp) ; clear a flag word 69 000010 010605 mov sp,r5 ; save stack pointer, and point to flag 70 000012 032702 000001 bit #1,r2 ; is r2 odd? 71 000016 001403 beq 10$ ; if eq, no - then print task name 72 000020 042702 000001 bic #1,r2 ; even up address 73 000024 005215 inc (r5) ; flag not to print task name 74 000026 012204 10$: mov (r2)+,r4 ; get # of arguments, point to first 75 000030 001402 beq 30$ ; if eq, none 76 000032 012246 20$: mov (r2)+,-(sp) ; put data, sign extended, on stack 77 000034 077402 sob r4,20$ ; count off this argument 78 000036 005715 30$: tst (r5) ; print task name? 79 000040 001012 bne 40$ ; if ne, no 80 000042 gtsk$s #outbuf ; get the task name 81 000054 103434 bcs 100$ ; if cs, error 82 000056 016746 000002' mov outbuf+2,-(sp) ; 2nd half of name 83 000062 016746 000000' mov outbuf,-(sp) ; 1st half 84 000066 010602 40$: mov sp,r2 ; and locate it for edmsg 85 000070 012700 000000' mov #outbuf,r0 ; and its destination 86 000074 004767 000000G call $edmsg ; format it 87 000100 qiow$s #io.wlb,r3,#flag,,,,<#outbuf,r1,#40> 88 000146 010506 100$: mov r5,sp ; clean off stack 89 000150 005726 tst (sp)+ ; clean flag off stack 90 000152 012605 mov (sp)+,r5 ; restore r5 91 000154 012604 mov (sp)+,r4 ; restore r4 92 000156 012600 mov (sp)+,r0 ; restore r0 93 000160 000207 return ; and exit 94 95 000001 .end Errmsg MACRO Y05.04 Tuesday 20-Jan-87 22:34 Page 2-1 Symbol table ERRMSG 000000RG 002 G.TSMT= 000022 G.TSRN= 000010 G.TSVL= 000030 RX$11M= 000001 FLAG = 000015 G.TSNL= 000020 G.TSSY= 000034 IO.WLB= ****** GX RX$11S= 000002 G.TSDU= 000036 G.TSPC= 000016 G.TSTN= 000000 OUTBUF 000000R 003 $EDMSG= ****** GX G.TSFW= 000024 G.TSPN= 000004 G.TSTS= 000032 RX$IAS= 000003 $$$ARG= 000002 G.TSGC= 000017 G.TSPR= 000014 G.TSVA= 000026 RX$11D= 000000 $$$OST= 000004 . ABS. 000000 000 (RW,I,GBL,ABS,OVR) 000000 001 (RW,I,LCL,REL,CON) $CODE 000162 002 (RO,I,LCL,REL,CON) $$BUF 000120 003 (RW,D,GBL,REL,OVR) Errors detected: 0 *** Assembler statistics Work file reads: 0 Work file writes: 0 Size of work file: 9200 Words ( 36 Pages) Size of core pool: 10298 Words ( 39 Pages) Operating system: RSX-11M/PLUS Elapsed time: 00:00:04.19 ERRMSG,ERRMSG/-SP=ERRMSG