      .title   errmes
;
;     This routine prints the message associated with a given
;     error code.
;     It is an equivalent of the previous FORTRAN routine
;     of the same name. The advantage of this implimentation is
;     that it is re-entrant and hence callable from an AST.
;
      .list meb
errmes::
      .word    ^m<r2>
      clrl     -(sp)
;     pushl    @4(ap)
;     pushl    #1
      movzbl   (ap),r1     ; r1 has counter of # of args
loop: movl     (ap)[r1],r2 ; r2 has addr of an arg (in reverse order)
      pushl    (r2)        ; store arg on stack in reverse order
      sobgtr   r1,loop  ; decrement ptr and loop till no more left
      pushl    (ap)     ; save arg count.
      moval    (sp),r2
      $putmsg_s   msgvec=(r2)
      blbc     r0,baderr
      ret
baderr:
      $exit_s  code=#ss$_abort
      .end
