home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / test / pdp11 / krter0.mac < prev    next >
Text File  |  1996-10-17  |  2KB  |  88 lines

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