I think, at this point, it may be worth diving a bit more into the history of DEC’s skip instructions. Meaning, having a look at the PDP-1 (announcement and first prototype 1959, first production prototype at BBN 1960, commercial introduction 1961).
Generally, the PDP-1 uses skip instructions (as opposed to branching) for any conditions. These skip instructions are all in a microcoded and microprogrammable group (meaning, you may combine any of its members in single instruction by OR-ing their bit-patterns), the “skip group”, which gives you
- SMA – skip on minus AC (sign bit set)
- SPA – skip on plus AC (sign bit clear)
- SZA – skip on (+) zero AC (no bits set)
- SZFn – skip on programmer flag n (1…6) zero
- SZSn – skip on sense switch n (1…6) zero
- SZO – skip on overflow flag zero
However, there’s also another skip instruction, similar to what’s on the PDP-8, providing an essential building block for any loops counting up from a negative number to zero,
- ISP addr – index (increment) addr and skip next instruction, if it’s zero after the increment
as well as two (non-combinable) skip instructions for comparing the accumulator to the contents of a given address (skip on equal and skip on unequal).
There’s just a single built-in instruction (SZO), which actually examines the error status of the machine, namely the overflow flag, which is set on an overflow of an addition. (On a side-note, I know no MIT code that would make use of this, while a display routine by Ben Gurley, the designer of the PDP-1, makes frequent use of it. – Gurley’s code uses overflow for implicit range checking, while code originating at MIT tends to be more defensive about these things. Also, Gurly’s code isn’t that tight or optimized, giving the impression that the machine is fast and resources are ample, anyways.)
Initially, there are no I/O related error states to be checked. Rather, the PDP-1 makes use of a synchronization pules for it’s IO equipment, which generally operates asynchronously, and there are variations of IO instructions that will halt and await such a “completion pulse” from the peripheral device. (There’s also a rather sophisticated interrupt circuitry, “sequence break” in DEC terms, and DMA, but this is another story.)
Apart from SZO, which is really an outlier (as it also clears the flag on read, as we know it from interrupt states on later hardware), there’s no notion of an error condition. This only comes into play with the BBN routine for division:
/BBN Divide subroutine
(...)
dv2, sub idv / initial subtraction (dividend - divisor)
sma / negative? (divisor > dividend)
jmp dve / no, abort on overflow
(...)
idx dv1 / good divide, increment return address
dve, idx dv1 / increment return address
(...)
As we may see, if the divisor isn’t greater than the dividend, we abort the routine at label “dve”, where what’s used as the return address is incremented. As we me also see, just before this, taking the normal path, the return address is incremented, as well. Therefore, there are 2 effective exits, one for the error condition and one, immediately after this, for a successful division.
As the BBN routine was soon implemented in hardware as the “automatic multiply and divide, type 10”, this became DEC’s first error trap: if we call a division, the address immediately after this is where we return on an error condition, otherwise, this address is skipped on a successful operation. Notably, this is not your common skip instruction, but comes from a different direction.
On the PDP-8, we see lots of skip instructions related to peripheral hardware states. (As mentioned before, this was mostly handled by a “completion pulse” on the PDP-1). On the PDP-1, we get the first glimpse of this in 1964, with the Automatic Magnetic Tape Control, Type 510:
- SCF – skip if tape control free
There had been tape controllers before this, namely the Programmed Magnetic Tape Control, Type 51, and its more sophisticated twin, the Automatic Magnetic Tape Control, Type 52, but neither of these gave you an additional skip instruction. It’s only with the Type 510 that we get this on the PDP-1. And this isn’t mentioned in the June 1963 handbook, but it’s in the PDP-1 Handbook from October 1964, and it’s in the price list from June 1964, where it’s all yours for the reasonable price of just USD 21,200 ($ 205,735 in today’s money).