home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pdp11 / k11err.mac < prev    next >
Text File  |  2020-01-01  |  2KB  |  78 lines

  1.     .title    rmserr    get rms11 error text
  2.     .ident    /82.01/
  3.     .psect
  4.  
  5.  
  6.  
  7. ;    Copyright (C) 1983 Brian Nelson for the MINITAB project
  8. ;
  9. ;
  10. ;    R M S E R R
  11. ;
  12. ;    byte errtext(64)
  13. ;    integer errnum
  14. ;    call rmserr(errnum,errtext)
  15. ;
  16. ;    module size: 14450 (8) bytes, 3220 (10) words
  17. ;
  18. ;
  19. ;     Return RMS11 error text to MINITAB, just as the
  20. ;    modules FCSERR and FIPERR do for RSX11M and RSTS
  21.  
  22.     .sbttl    get the error text
  23.  
  24. rmserr::cmp    @2(r5)    ,#-624.
  25.     ble    10$
  26.     call    rmser1
  27.     return
  28. 10$:    cmp    @2(r5)    ,#-1184.
  29.     ble    20$
  30.     call    rmser2
  31.     return
  32. 20$:    call    rmser3
  33.     return
  34.  
  35.     .globl    rmser1    ,rmser2    ,rmser3
  36.  
  37.  
  38.     .mcall    qiow$s
  39.  
  40. rmserp::mov    r1    ,-(sp)        ;save fab addr
  41.     mov    r2    ,-(sp)        ;brian is a fanatic
  42.     mov    r5    ,-(sp)
  43.     sub    #102    ,sp        ;error text buffer
  44.     mov    sp    ,r1        ;pointer to e.t.buffer
  45.     mov    r0    ,-(sp)        ;put error code on stack
  46.     mov    sp    ,r2        ;point to it
  47.     mov    r1    ,-(sp)        ;"new" 
  48.     mov    r2    ,-(sp)        ;pointers to pointers
  49.     mov    #2    ,-(sp)        ;number of args
  50.     mov    sp    ,r5        ;point to pointers to pointers
  51.     call    rmserr            ;picks up arg list ptr from r5
  52.     add    #4*2    ,sp        ;pop args
  53.     qiow$s    #io.wlb,#5,#13,,,,<r1,#100>    ;print msg
  54.     add    #102    ,sp        ;restore stack pointer
  55.     mov    (sp)+    ,r5
  56.     mov    (sp)+    ,r2        ;   "     reg 2
  57.     mov    (sp)+    ,r1        ;   "      "  1
  58.     return
  59.  
  60.  
  61.  
  62. rmserx::mov    #77-5    ,r1        ; maxlength of 77 (8) bytes
  63.     movb    #'E    ,(r2)+
  64.     movb    #'R    ,(r2)+
  65.     movb    #'$    ,(r2)+
  66.     movb    (r0)+    ,(r2)+        ; copy error name over
  67.     movb    (r0)+    ,(r2)+        ; copy until 63 characters or a
  68.     movb    (r0)+    ,(r2)+        ; copy until 63 characters or a
  69.     movb    #40    ,(r2)+
  70.     movb    #40    ,(r2)+
  71. 40$:    movb    (r0)+    ,(r2)+        ; copy until 63 characters or a
  72.     beq    50$            ; null byte is found
  73.     sob    r1    ,40$        ; next please
  74. 50$:    clrb    @r2            ; insure .asciz for output text
  75.     return
  76.  
  77.     .end
  78.