home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pub / rt11 / krterr.mac < prev    next >
Text File  |  2020-01-01  |  14KB  |  354 lines

  1.     .title    KRTERR    Error code to message text translation
  2.     .ident    "V03.63"
  3.  
  4. ; /63/    27-Sep-97  Billy Youdelman  V03.63
  5. ;
  6. ;    strip trailing blank from prompt string when making error message
  7. ;    add er$wpe, er$dna
  8.  
  9. ; /62/    27-Jul-93  Billy Youdelman  V03.62
  10. ;
  11. ;    add error message for logfile problems
  12.  
  13. ; /BBS/     1-Dec-91  Billy Youdelman  V03.61
  14. ;
  15. ;    moved error message prefix routine here from KRTPAK
  16. ;    moved all system error messages here, from various modules
  17.  
  18. ;    Brian Nelson  10-Aug-84  09:24:56
  19. ;
  20. ;    Copyright 1984 Change Software, Inc.
  21.  
  22.  
  23.     .include "IN:KRTMAC.MAC"
  24.     .iif ndf  KRTINC  .error    <; .include for IN:KRTMAC.MAC failed>
  25.  
  26.  
  27.     .psect    $pdata
  28.     .sbttl    Error codes defined
  29.  
  30.     ; Kermit's main loop handles these five errors
  31.     cmd$ab    ==    -1        ; ^C abort
  32.     cmd$ex    ==    -2        ; ^Z exit
  33.     cmd$nx    ==    -3        ; ^Z but don't exit to monitor
  34.     cmd$bad    ==    -4        ; unrecognizable
  35.     cmd$un    ==    -5        ; ambiguous
  36.  
  37.     er$ful    ==    -6        ; not enough room
  38.     er$nmf    ==    -7        ; no more files
  39.     er$iop    ==    -10        ; invalid I/O request
  40.     er$sys    ==    -11        ; system error
  41.     er$lby    ==    -12        ; lun open
  42.     er$rer    ==    -13        ; read error
  43.     er$wer    ==    -14        ; write error
  44.     er$prv    ==    -15        ; protection error
  45.     er$rtb    ==    -16        ; record too big
  46.     er$que    ==    -17        ; no free que element
  47.     er$nin    ==    -20        ; no data available
  48.     er$spx    ==    -21        ; speed not settable
  49.     er$pls    ==    -22        ; please set line first
  50.     er$lgf    ==    -23        ; please open a logfile first
  51.     er$raw    ==    -24        ; can't log raw I/O with other opts
  52.     er$rax    ==    -25        ; can't do this with raw logging
  53.     er$mal    ==    -26        ; malloc can't get enough memory
  54.     er$spe    ==    -27        ; unknown speed
  55.     er$sy1    ==    -30        ; .close system error
  56.     er$sy2    ==    -31        ; .csispc system error
  57.     er$sy3    ==    -32        ; .enter system error
  58.     er$sy4    ==    -33        ; .fetch system error
  59.     er$vol    ==    -34        ; not an RT-11 disk volume
  60.     er$nop    ==    -35        ; I/O channel not open
  61.     er$wld    ==    -36        ; no wildcard support
  62.     er$xco    ==    -37        ; could not access XC/XL
  63.     er$bnl    ==    -40        ; binary types list is full
  64.     er$one    ==    -41        ; illegal file type
  65.     er$fet    ==    -42        ; no room to load handler
  66.     er$ukn    ==    -43        ; illegal serial line device name
  67.     fa$imp    ==    -44        ; /51/ .serr fatal errors
  68.     fa$nhd    ==    -45        ; /51/ no device handler
  69.     fa$dio    ==    -46        ; /51/ error in directory I/O
  70.     fa$fet    ==    -47        ; /51/ fetch error
  71.     fa$ovr    ==    -50        ; /51/ overlay error
  72.     fa$dfl    ==    -51        ; /51/ directory full
  73.     fa$adr    ==    -52        ; /51/ bad address
  74.     fa$lun    ==    -53        ; /51/ bad lun
  75.     fa$idr    ==    -54        ; TSX+ access restricted
  76.     er$fgf    ==    -55        ; /51/ can't fetch in FG
  77.     er$try    ==    -56        ; retries must be 3 to 30 only
  78.     er$ld1    ==    -57        ; invalid LD unit #
  79.     er$ld5    ==    -60        ; LD nesting error
  80.     er$tim    ==    -61        ; set time-out error
  81.     ld$bsy    ==    -62        ; chan(s) open to a logical disk
  82.     er$txp    ==    -63        ; /62/ packet min len is 20 bytes
  83.     er$bad    ==    -64        ; bad option or value
  84.     er$sam    ==    -65        ; ambiguous set command
  85.     er$sun    ==    -66        ; unrecognizable set command
  86.     er$tt    ==    -67        ; can't connect TT to TT
  87.     er$ass    ==    -70        ; assign error
  88.     er$ram    ==    -71        ; ambiguous REMOTE command
  89.     er$run    ==    -72        ; unrecognizable REMOTE command
  90.     er$unr    ==    -73        ; unrecognizable command
  91.     er$amb    ==    -74        ; ambiguous command
  92.     er$snd    ==    -75        ; send syntax error
  93.     er$get    ==    -76        ; get syntax error
  94.     er$not    ==    -77        ; not a local Kermit..
  95.     er$dk    ==    -100        ; only supported assign is DK
  96.     er$tam    ==    -101        ; ambiguous SHOW command
  97.     er$tun    ==    -102        ; unrecognizable SHOW command
  98.     er$ser    ==    -103        ; no server subcommands
  99.     er$abt    ==    -104        ; process aborted
  100.     er$dcd    ==    -105        ; can't dial whilst DCD is asserted
  101.     er$inr    ==    -106        ; invalid number of retries
  102.     er$npn    ==    -107        ; no previous number dialed
  103.     er$mdm    ==    -110        ; please set modem first
  104.     er$ndf    ==    -111        ; no dial formatting string
  105.     er$idl    ==    -112        ; can't release modem
  106.     er$unm    ==    -113        ; unknown modem type
  107.     er$nnf    ==    -114        ; no number found for name
  108.     er$abk    ==    -115        ; aborted from keyboard
  109.     er$wke    ==    -116        ; can't get wake string from modem
  110.     er$tsx    ==    -117        ; only supported under TSX
  111.     er$120    ==    -120        ; already allocated or in use
  112.     er$121    ==    -121        ; invalid unit number
  113.     er$122    ==    -122        ; TSX allocation table is full
  114.     er$123    ==    -123        ; ALLOCATE privilege required
  115.     er$124    ==    -124        ; TERMINAL privilege required
  116.     er$125    ==    -125        ; invalid TSX line number
  117.     er$126    ==    -126        ; already assigned to a CL unit
  118.     er$127    ==    -127        ; in use by a time-sharing user
  119.     er$oct    ==    -130        ; must be octal 1 to 36 only
  120.     er$dev    ==    -131        ; device not responding
  121.     er$eof    ==    -132        ; end of file
  122.     er$fnf    ==    -133        ; file not found
  123.     er$iln    ==    -134        ; illegal logical name
  124.     er$aop    ==    -135        ; ambiguous option or value
  125.     er$own    ==    -136        ; CL unit not owned by this job
  126.     er$137    ==    -137        ; you are already using this device
  127.     er$140    ==    -140        ; must drop current assign first
  128.     er$141    ==    -141        ; no ports and/or units supplied
  129.     er$142    ==    -142        ; none of specified CL units is free
  130.     er$143    ==    -143        ; none of specified TSX lines is free
  131.     er$144    ==    -144        ; bad delimiter in PORTS string
  132.     er$145    ==    -145        ; SET SPEED from PORTS string failed
  133.     er$146    ==    -146        ; SET MODEM from PORTS string failed
  134.     er$147    ==    -147        ; bad XMODE value in PORTS string
  135.     er$150    ==    -150        ; can't .close XL once it's opened
  136.     er$pri    ==    -151        ; TSX priority bump bad value error
  137.     er$v62    ==    -152        ; TSX V6.2 or above needed to do this
  138.     er$v63    ==    -153        ; ditto re TSX V6.3 or above
  139.     er$wks    ==    -154        ; wake string is undefined
  140.     er$lwe    ==    -155        ; logfile write error
  141.     er$fnm    ==    -156        ; bad file name
  142.     er$km    ==    -157        ; KM handler only
  143.     er$ttx    ==    -160        ; /63/ TT not supported here
  144.     er$wpe    ==    -161        ; /63/ attempt to write past eof
  145.     er$dna    ==    -162        ; /63/ bad device name
  146.  
  147.     maxerr    =     162        ; must be abs(maxerr)
  148.  
  149.  
  150.     .sbttl    Error messages mapped
  151.  
  152. errmap:    .word    baderr        ; come here when error doesn't map
  153.     .word    10$,20$,30$,40$,50$,60$,70$,100$,110$,120$
  154.     .word    130$,140$,150$,160$,170$,200$,210$,220$,230$,240$,250$
  155.     .word    260$,270$,300$,310$,320$,330$,340$,350$,360$,370$,400$
  156.     .word    410$,420$,430$,440$,450$,460$,470$,500$,510$,520$,530$
  157.     .word    540$,550$,560$,570$,600$,610$,620$,630$,640$,650$,660$
  158.     .word    670$,700$,710$,720$,730$,740$,750$,760$,770$,1000$
  159.     .word    1010$,1020$,1030$,1040$,1050$,1060$,1070$,1100$,1110$
  160.     .word    1120$,1130$,1140$,1150$,1160$,1170$,1200$,1210$,1220$
  161.     .word    1230$,1240$,1250$,1260$,1270$,1300$,1310$,1320$,1330$
  162.     .word    1340$,1350$,1360$,1370$,1400$,1410$,1420$,1430$,1440$
  163.     .word    1450$,1460$,1470$,1500$,1510$,1520$,1530$,1540$,1550$
  164.     .word    1560$,1570$,1600$,1610$,1620$    ; /63/
  165.  
  166. ; /62/    These first five errors are always handled by Kermit's main loop
  167. 10$:    ;    cmd$ab    ==    -1        ; ^C abort
  168. 20$:    ;    cmd$ex    ==    -2        ; ^Z exit
  169. 30$:    ;    cmd$nx    ==    -3        ; ^Z but don't exit to monitor
  170. 40$:    ;    cmd$bad    ==    -4        ; unrecognizable
  171. 50$:    ;    cmd$un    ==    -5        ; ambiguous
  172.     .asciz    "Error handling failed!"    ; just in case
  173.  
  174. 60$:    .asciz    "Not enough room"
  175. 70$:    .asciz    "No more files"
  176. 100$:    .asciz    "Invalid I/O request"
  177. 110$:    .asciz    "System error"
  178. 120$:    .asciz    "Logical unit already open"
  179. 130$:    .asciz    "Device read error"
  180. 140$:    .asciz    "Device write error"
  181. 150$:    .asciz    "File is protected"
  182. 160$:    .asciz    "Record too long for GETREC buffer"
  183. 170$:    .asciz    "No queue element free"
  184. 200$:    .asciz    "No data available"
  185. 210$:    .asciz    "Speed not settable"
  186. 220$:    .asciz    "Please SET LINE first"
  187. 230$:    .asciz    "Please open a LOGFILE first"
  188. 240$:    .asciz    "Can't log RAW I/O with another disk-based DEBUG option set"
  189. 250$:    .asciz    "Can't do this with RAW I/O logging on"
  190. 260$:    .asciz    "Insufficient free memory remaining"
  191. 270$:    .asciz    "Unknown speed"
  192. 300$:    .asciz    ".CLOSE system error"
  193. 310$:    .asciz    ".CSISPC system error"
  194. 320$:    .asciz    ".ENTER system error"
  195. 330$:    .asciz    ".FETCH system error"
  196. 340$:    .asciz    "Disk home block not RT-11 format, see HELP SET FILE NOVOL"
  197. 350$:    .asciz    "I/O channel not open"
  198. 360$:    .asciz    "Multiple files or wildcarding not supported here"
  199. 370$:    .asciz    "Can't open the communications port"
  200. 400$:    .asciz    "Maximum of 31 entries in the BINARY-TYPE list"
  201. 410$:    .asciz    "Illegal file type string"
  202. 420$:    .asciz    "Insufficient lowcore memory to load handler"
  203. 430$:    .asciz    "Illegal serial line device name"
  204. 440$:    .asciz    "Unknown .SERR error"            ; /62/
  205. 450$:    .asciz    "No device handler or device not responding" ; /62/
  206. 460$:    .asciz    "Directory I/O error"            ; /51/
  207. 470$:    .asciz    ".FETCH error, please LOAD handler"    ; /51/
  208. 500$:    .asciz    "Overlay read error"            ; /51/
  209. 510$:    .asciz    "Directory is full"            ; /51/
  210. 520$:    .asciz    "Invalid address"            ; /51/
  211. 530$:    .asciz    "Invalid channel"            ; /51/
  212. 540$:    .asciz    "Device or file is access restricted"    ; /BBS/ TSX+ uses this
  213. 550$:    .asciz    "Can't .FETCH in Foreground, please LOAD handler" ; /51/
  214. 560$:    .asciz    "Retries must be between 3 and 30"
  215. 570$:    .asciz    "Invalid logical device, LD0 to LD7 only"
  216. 600$:    .asciz    "Logical disks must be nested in increasing unit number order"
  217. 610$:    .asciz    "Time-out must be between 0 and 94"    ; /62/
  218. 620$:    .asciz    "Channel open to a logical disk"
  219. 630$:    .asciz    "Minimum packet length is 20"        ; /62/
  220. 640$:    .asciz    "Bad option or value"
  221. 650$:    .asciz    "Ambiguous SET command"
  222. 660$:    .asciz    "Unrecognizable SET command"
  223. 670$:    .asciz    "Can't connect TT to TT"
  224. 700$:    .asciz    "Syntax is ASS dev DK, only DK is supported"
  225. 710$:    .asciz    "Ambiguous REMOTE command"
  226. 720$:    .asciz    "Unrecognizable REMOTE command"
  227. 730$:    .asciz    "Unrecognizable command"
  228. 740$:    .asciz    "Ambiguous command"
  229. 750$:    .asciz    "Syntax is SEND file.typ [dev:][asfile.new]"
  230. 760$:    .asciz    "Syntax is GET file.typ [dev:][asfile.new]"
  231. 770$:    .asciz    "Not running as a LOCAL Kermit"
  232. 1000$:    .asciz    "The only supported logical assign is DK"
  233. 1010$:    .asciz    "Ambiguous SHOW command"
  234. 1020$:    .asciz    "Unrecognizable SHOW command"
  235. 1030$:    .asciz    "Server sub-commands are not supported"
  236. 1040$:    .asciz    "Process aborted"
  237. 1050$:    .asciz    "Can't DIAL whilst DCD is asserted, use HANGUP first"
  238. 1060$:    .asciz    "Invalid number of retries"
  239. 1070$:    .asciz    "No previous number dialed"
  240. 1100$:    .asciz    "Please SET MODEM first"
  241. 1110$:    .asciz    "FORMAT string undefined"
  242. 1120$:    .asciz    "Modem not restored to its idle state"
  243. 1130$:    .asciz    "Unknown modem type"
  244. 1140$:    .asciz    "No number found for specified name"
  245. 1150$:    .asciz    "Aborted from keyboard"
  246. 1160$:    .asciz    "Can't get wake$prompt from modem"
  247. 1170$:    .asciz    "Available under TSX-Plus only"
  248. 1200$:    .asciz    "CL unit allocated or in use by another job"
  249. 1210$:    .asciz    "Invalid CL unit number"
  250. 1220$:    .asciz    "TSX allocation table full"
  251. 1230$:    .asciz    "ALLOCATE privilege required"
  252. 1240$:    .asciz    "TERMINAL privilege required"
  253. 1250$:    .asciz    "Invalid TSX line number"
  254. 1260$:    .asciz    "Line already assigned to a CL unit"
  255. 1270$:    .asciz    "Line in use by a time-sharing user"
  256. 1300$:    .asciz    "Range is 1 to 36 octal"
  257. 1310$:    .asciz    "Device not responding"    ; /BBS/ distinguish from no access
  258. 1320$:    .asciz    "End of file"
  259. 1330$:    .asciz    "File not found"
  260. 1340$:    .asciz    "Illegal logical name"
  261. 1350$:    .asciz    "Ambiguous option or value"
  262. 1360$:    .asciz    "Specified CL unit is not the current link device"
  263. 1370$:    .asciz    "You are already using this device on another job"
  264. 1400$:    .asciz    "Current device must be dropped (SET LINE TT) first"
  265. 1410$:    .asciz    "Bad or missing data in PORTS or UNITS string"
  266. 1420$:    .asciz    "No specified CL unit is free"
  267. 1430$:    .asciz    "No specified TSX line is free"
  268. 1440$:    .asciz    "Bad parameter delimiter in PORTS string"
  269. 1450$:    .asciz    "SET SPEED from value in PORTS string failed"
  270. 1460$:    .asciz    "SET MODEM from type in PORTS string failed"
  271. 1470$:    .asciz    "SET PHO XMODE from value in PORTS string failed"
  272. 1500$:    .asciz    "Current device can only be released by exiting Kermit"
  273. 1510$:    .asciz    "Priority range is 1 to 127"
  274. 1520$:    .asciz    "TSX V6.2 or above required"
  275. 1530$:    .asciz    "TSX V6.3 or above required"
  276. 1540$:    .asciz    "WAKE-STRING undefined"
  277. 1550$:    .asciz    "Logfile write error"
  278. 1560$:    .asciz    "Bad file name"
  279. 1570$:    .asciz    "KM handler required"
  280. 1600$:    .asciz    "TT is not supported here"    ; /63/
  281. 1610$:    .asciz    "Attempt to write past EOF, possible FILE-TYPE mis-match"
  282. 1620$:    .asciz    "Bad device name"        ; /63/
  283. baderr:    .asciz    "Unknown error  r0 = "
  284.     .even
  285.  
  286.  
  287.     .psect    $code
  288.     .sbttl    Error message generator    ; /BBS/ somewhat changed..
  289.  
  290. ;    S Y S E R R
  291. ;
  292. ;    input:      (r5)    = error number
  293. ;    output:     2(r5)    = buffer for error message text
  294.  
  295. ;    .save
  296. ;    .psect    $pdata
  297. ;prefix:.asciz    "?KRTBBS-E-"        ; error message header for the bbs
  298. ;    .even
  299. ;    .restore
  300.  
  301. syserr::save    <r0,r1,r2>
  302.     mov    #baderr    ,r1        ; preset bad error text
  303.     mov    2(r5)    ,r2        ; pointer for err msg out buff
  304.  
  305.     movb    #'?    ,(r2)+        ; insert RT-11 err msg ident
  306.     mov    #prompt    ,r0        ; point to prompt
  307. 10$:    movb    (r0)+    ,(r2)+        ; copy the prompt into err msg
  308.     beq    20$            ; that's it..
  309.     cmpb    -1(r2)    ,#'z!40        ; try against a lower case "z"
  310.     bhi    10$            ; it's higher..
  311.     cmpb    -1(r2)    ,#'a!40        ; try against a lower case "a"
  312.     blo    10$            ; it's lower..
  313.      bicb    #40    ,-1(r2)        ; char is in range, translate
  314.     br    10$            ; next one..
  315. 20$:    dec    r2            ; back up over null
  316. 30$:    cmpb    -1(r2)    ,#space        ; /63/ trailing blank?
  317.     beq    40$            ; /63/ ya, hose it
  318.     cmpb    -1(r2)    ,#'>        ; trailing ">" ?
  319.     bne    50$            ; no
  320. 40$:    tstb    -(r2)            ; back up over unwanted char
  321.     br    30$            ; /63/ and look for another..
  322.  
  323. 50$:    movb    #'-    ,(r2)+        ; and append
  324.     movb    #'E    ,(r2)+        ; severity code
  325.     movb    #'-    ,(r2)+        ; "Kermit-11-E-"
  326.  
  327. ; /BBS/    this is only for the bbs..
  328. ;    mov    #prefix    ,r0        ; slug as from this err handler
  329. ;10$:    movb    (r0)+    ,(r2)+        ; copy the prompt into err msg
  330. ;    bne    10$            ; until a null is copied
  331. ;    dec    r2            ; back up over null
  332.  
  333.     mov    (r5)    ,r0        ; the error number
  334.     bge    60$            ; if =>0 it's ok
  335.     neg    r0            ; else change sign
  336. 60$:    cmp    r0    ,#maxerr    ; is this a valid call today?
  337.     bhi    70$            ; no
  338.     asl    r0            ; ya, get error number into word
  339.     mov    errmap(r0),r1        ; offset and get the text address
  340. 70$:    mov    r1    ,-(sp)        ; save pointer to actual err msg
  341. 80$:    movb    (r1)+    ,(r2)+        ; then copy it until a null byte
  342.     bne    80$            ; next please
  343.     cmp    (sp)+    ,#baderr    ; is it "unknown error call" ?
  344.     bne    90$            ; no
  345.     movb    #'<    ,-1(r2)        ; yes, put "<" where null wuz
  346.     calls    l$otoa    ,<r2,2(r5)>    ; convert octal number to ascii
  347.     add    #6    ,r2        ; skip past the converted number
  348.     movb    #'>    ,(r2)+        ; terminate the string
  349.     clrb    (r2)            ; finally, .asciz please
  350. 90$:    unsave    <r2,r1,r0>
  351.     return
  352.  
  353.     .end
  354.