Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

OpenVMS (née VMS) function calls and signals use the low bit set to indicate success, and the low bit clear to indicate failure; the condition value format.

The high bits of the condition value format can also tell you more about what component returned the error, and there were a few control flags up in the highest bits, including bit 31 (the sign bit) which inhibited message display.

Somewhat unusually, the low three bits of the condition status value are used to indicate varying levels of success or failure; the success (0b001), informational (0b011), warning (0b000), error (0b010) and severe/fatal (0b100) errors.

VAX had the BLBS and BLBS instructions for testing and branching on the low bit, too.

These success- and failure-testing instructions were separate from the BEQL/BEQU, BNEQ/BNEQU, BGTR/BGRTU, BGEQ/BGEQU, BLSS/BLSSU and BLEQ/BLEQU that looked at whether the signed or unsigned value was positive, zero or negative, or zero or greater, or zero or less. A condition value that had been displayed or otherwise inhibited was switched to a negative value.

Yes, VAX had a lot of instructions.

This usage of the low bit also led to the semi-inevitable "Success on VMS being odd" in-joke.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: