Article View: comp.arch
Article #10946Re: Any use for Branch if Even/Odd ?
From: Peter Mayne
Date: Tue, 15 Dec 1992 02:45
Date: Tue, 15 Dec 1992 02:45
59 lines
2835 bytes
2835 bytes
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? VMS status codes record more than just true/false. The bottom three bits of a status code are encoded as follows: 0 Warning 1 Success 2 Error 3 Informational 4 Severe error 5 Reserved to Digital 6 Reserved to Digital 7 Reserved to Digital The other bits are: 3-15 Indicates the particular condition that occurred. 16-27 Indicates the system facility in which the condition occurred. 28-31 Control bits. Thus from a status code, it is not only possible to discover the success or failure of a routine or program (for example), but the degree of success or failure, the actual error that occurred, the facility (part of VMS, an application, etc) that caused that error, and whether that error has been signalled. In this way, it is possible, for instance, to see three different status codes to discover why SEARCH failed, e.g.: $ SEARCH FILE.TXT STRING %SEARCH-W-OPENIN, error opening DISK:[DIR]FILE.TXT;1 as input -RMS-E-PRV, insufficient privilege or file protection violation %SEARCH-I-NOMATCHES, no strings matched $ Opinion: If the status codes were at the high end of the longword, the error codes for a particular facility would be scattered all over the range instead of in a single group of numbers; harder for us humans to comprehend. Given that the VAX architecture has bit test operations, why not do it this way? Anyway, don't ask me, ask the developers. :-) >-andy >-- PJDM -- Peter Mayne | My statements, not Digital's. Digital Equipment Corporation | Canberra, ACT, Australia | "AXP!": Bill the Cat
Technical Details
Message-ID:
<1992Dec15.024545.7336@ryn.mro4.dec.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!news!nntpd.lkg.dec.com!ryn.mro4.dec.com!newsReferences:
<endecotp.723992157@cs.man.ac.uk> <Bz2MMK.GIL@world.std.com> <id.08RV.WYB@ferranti.com> <1992Dec14.203631.16388@CSD-NewsHost.Stanford.EDU>Show Full Headers
Complete Article Headers
Newsgroups: comp.arch Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!news!nntpd.lkg.dec.com!ryn.mro4.dec.com!news From: pjdm@chmeee.enet.dec.com (Peter Mayne) Subject: Re: Any use for Branch if Even/Odd ? Message-ID: <1992Dec15.024545.7336@ryn.mro4.dec.com> Lines: 60 Sender: news@ryn.mro4.dec.com (USENET News System) Reply-To: Peter.Mayne@cao.mts.dec.com Organization: Digital Equipment Corporation References: <endecotp.723992157@cs.man.ac.uk> <Bz2MMK.GIL@world.std.com> <id.08RV.WYB@ferranti.com> <1992Dec14.203631.16388@CSD-NewsHost.Stanford.EDU> Date: Tue, 15 Dec 1992 02:45:45 GMT