home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / arch / 11671 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  2.8 KB

  1. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!rutgers!igor.rutgers.edu!zodiac.rutgers.edu!leichter
  2. From: leichter@zodiac.rutgers.edu
  3. Newsgroups: comp.arch
  4. Subject: Re: Any use for Branch if Even/Odd ?
  5. Message-ID: <1992Dec15.144752.1@zodiac.rutgers.edu>
  6. Date: 15 Dec 92 19:47:52 GMT
  7. References: <endecotp.723992157@cs.man.ac.uk> <Bz2MMK.GIL@world.std.com> <id.08RV.WYB@ferranti.com> <1992Dec14.203631.16388@CSD-NewsHost.Stanford.EDU>
  8. Sender: news@igor.rutgers.edu
  9. Organization: Rutgers University Department of Computer Science
  10. Lines: 49
  11. Nntp-Posting-Host: pisces.rutgers.edu
  12.  
  13. In article <1992Dec14.203631.16388@CSD-NewsHost.Stanford.EDU>,
  14. andy@SAIL.Stanford.EDU (Andy Freeman) writes:
  15. | In article <id.08RV.WYB@ferranti.com> peter@ferranti.com (peter da silva)
  16. | writes:
  17. |>Close. As I recall, DEC is very fond of using even/odd for true/false
  18. |>values, and the VMS interface definition has a lot of even/odd status
  19. |>returns, so it's likely these instructions are to make it run VMS real good.
  20. | Does anyone know why they preferred even/odd to >=0/<0?  Sometimes one
  21. | has to test the sign bit, so why not use it whenever one can use any
  22. | bit to split things into two classes?
  23.  
  24. It's tough to reconstruct that kind of decision years after the fact.  I can
  25. suggest two ways in which using the bottom bit works better:
  26.  
  27.     - Both TRUE=1 and TRUE=-1 are reasonably common representations in
  28.         existing languages.  Using the bottom bit works for both;
  29.         using the top doesn't.
  30.  
  31.     - The actual representation of a VMS condition value is more complex
  32.         than has been described so far.  Reading from the least signi-
  33.         ficant bit, we have:
  34.  
  35.             Severity:  3 bits.  Bottom bit set indicates some kind
  36.                 of successful completion (but it could be an
  37.                 "alternate success" status); bottom bit clear
  38.                 is some kind of failure, in which case the
  39.                 other two bits indicate how severe a failure.
  40.             Message number:  13 bits.
  41.             Facility number:  12 bits.  Globally assigned value
  42.                 that identifies the particular subsystem;
  43.                 most significant of these is 0 for DEC
  44.                 facilities, 1 for customer-defined facilities.
  45.             Control:  4 bits.
  46.  
  47.         The "SYS" facility is facility 0; status values returned by
  48.         this facility (which includes all values returned as a direct
  49.         result of system calls, in particular) always have the top
  50.         word of the condition value longword clear.  In some contexts,
  51.         the condition value is stored as a (16-bit) word, with an
  52.         implied zero-extension to a full longword condition value.
  53.  
  54.         This last is a hack that seems to have some connection to
  55.         VMS's RSX heritage; it also saved space in a day when VMS
  56.         ran on 128K systems.  But it means that you can't use the
  57.         top bit of a condition longword to encode success information,
  58.         since that bit may not be representable in some contexts.
  59.  
  60.                             -- Jerry
  61.