home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / arch / 11651 < prev    next >
Encoding:
Text File  |  1992-12-15  |  2.7 KB  |  73 lines

  1. Newsgroups: comp.arch
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!news!nntpd.lkg.dec.com!ryn.mro4.dec.com!news
  3. From: pjdm@chmeee.enet.dec.com (Peter Mayne)
  4. Subject: Re: Any use for Branch if Even/Odd ?
  5. Message-ID: <1992Dec15.024545.7336@ryn.mro4.dec.com>
  6. Lines: 60
  7. Sender: news@ryn.mro4.dec.com (USENET News System)
  8. Reply-To: Peter.Mayne@cao.mts.dec.com
  9. Organization: Digital Equipment Corporation
  10. References: <endecotp.723992157@cs.man.ac.uk> <Bz2MMK.GIL@world.std.com> <id.08RV.WYB@ferranti.com> <1992Dec14.203631.16388@CSD-NewsHost.Stanford.EDU>
  11. Date: Tue, 15 Dec 1992 02:45:45 GMT
  12.  
  13.  
  14. In article <1992Dec14.203631.16388@CSD-NewsHost.Stanford.EDU>, andy@SAIL.Stanford.EDU (Andy Freeman) writes:
  15.  
  16. >In article <id.08RV.WYB@ferranti.com> peter@ferranti.com (peter da silva) writes:
  17. >>Close. As I recall, DEC is very fond of using even/odd for true/false values,
  18. >>and the VMS interface definition has a lot of even/odd status returns, so it's
  19. >>likely these instructions are to make it run VMS real good.
  20. >
  21. >Does anyone know why they preferred even/odd to >=0/<0?  Sometimes one
  22. >has to test the sign bit, so why not use it whenever one can use any
  23. >bit to split things into two classes?
  24.  
  25. VMS status codes record more than just true/false. The bottom three bits of
  26. a status code are encoded as follows:
  27.  
  28. 0    Warning
  29. 1    Success
  30. 2    Error
  31. 3    Informational
  32. 4    Severe error
  33. 5    Reserved to Digital
  34. 6    Reserved to Digital
  35. 7    Reserved to Digital
  36.  
  37. The other bits are:
  38.  
  39. 3-15    Indicates the particular condition that occurred.
  40. 16-27    Indicates the system facility in which the condition occurred.
  41. 28-31    Control bits.
  42.  
  43. Thus from a status code, it is not only possible to discover the
  44. success or failure of a routine or program (for example), but the degree of
  45. success or failure, the actual error that occurred, the facility (part
  46. of VMS, an application, etc) that caused that error, and whether that error
  47. has been signalled. In this way, it is possible, for instance, to see three
  48. different status codes to discover why SEARCH failed, e.g.:
  49.  
  50. $ SEARCH FILE.TXT STRING
  51. %SEARCH-W-OPENIN, error opening DISK:[DIR]FILE.TXT;1 as input
  52. -RMS-E-PRV, insufficient privilege or file protection violation
  53. %SEARCH-I-NOMATCHES, no strings matched
  54. $
  55.  
  56. Opinion: If the status codes were at the high end of the longword, the
  57. error codes for a particular facility would be scattered all over the
  58. range instead of in a single group of numbers; harder for us humans to
  59. comprehend. Given that the VAX architecture has bit test operations,
  60. why not do it this way?
  61.  
  62. Anyway, don't ask me, ask the developers. :-)
  63.  
  64. >-andy
  65. >--
  66.  
  67. PJDM
  68. --
  69. Peter Mayne                     | My statements, not Digital's.
  70. Digital Equipment Corporation   |
  71. Canberra, ACT, Australia        | "AXP!": Bill the Cat
  72.  
  73.