/* k 0165	25/05/91	*/
/* k 0191	02/07/91	*/
/* k 0201	01/09/91	*/
/* k 0206	06/09/91	*//* variables */
/* k 0207	06/09/91	*/
/* k 0224       23/09/91        *//* ebss */
/* k 0303	23/02/92	*//* do not check rdos if it is not
					initialised */
/* k 0310       01/03/92	*//* message output */
#include <ebss.h>               /* @0224 */
#define Port_msg 0x10		/* @0201 */
struct rqb *Res_preqrq();	/* @0310 */
struct rqb *preqrq();		/* @0310 */
pmsgop(msgno,pno,pp)			/* @0191 *//* @0310 */
short msgno;			/* @0191 */
short pno;			/* @0310 */
short *pp;			/* @0310 */
{
 struct rqb *rp,*rrp;     /* @0308 */
#if (OVL_TYPE==0 || RESIDENT==1)	/* @0310 */
 if (rdos == NULL)	/* @0201 *//* @0303 *//* @0308 */
   psmsgop(msgno,pno,pp);	/* @0191 *//* @0310 */
 else                    /* @0308 */
#endif					/* @0310 */
   if (vt_flag & VT_MODE && *rdos==0)			/* @0310 */
#if (OVL_TYPE==1 && RESIDENT==1)	/* @0310 */
     Trn_psmsgop(msgno,pno,pp);	/* @0191 *//* @0308 *//* @0310 */
#else					/* @0310 */
     psmsgop(msgno,pno,pp);	/* @0310 *//* @0310 */
#endif
   else				/* @0201 */
#if (OVL_TYPE==1 &&  RESIDENT==0)	/* @0310 */
     if ((rp=Res_preqrq(1))!=0)       /* @0308 *//* @0310 */
#else				/* @0310 */
     if ((rp=preqrq(1))!=0)       /* @0308 */
#endif			/* @0310 */
       {				/* @0201 */
	 rp->th.ra.rparm.parm.parm1=msgno;	/* @0310 */
	 rp->th.ra.rparm.parm.parm2=pno;	/* @0310 */
	 rp->th.ra.wa.rqba.area1=pp;	/* @0310 */
	 rrp=(struct rqb *)(&(avt->msgq));   /* @0308 */
         while (rrp->link!=0)                /* @0308 */
           rrp=rrp->link;                    /* @0308 */
         rrp->link=rp;                       /* @0308 */
	 if (vt_flag & VT_MODE)		/* @0310 */
	   Flag28 |= Port_msg;		/* @0201 *//* @0310 */
	}				/* @0201 */
}
