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