- Sense switch
A sense switch or program switch, is a switch on the console of a computer whose state can be tested by conditional branch instructions in software. Most early computers had several sense switches. They were typically used by the operator to set program options.
On the IBM 1620 there were four, and their state could be tested via special forms of the IF-statement offered by the fortran compiler for the IBM 1620 and of course no other computer. For the IBM 1130 there were sixteen switches matching the sixteen-bit word size of the computer, plus a toggle switch adjacent to the power on/off switch. These bit-switches were more normally used with the computer stopped to specify some memory address to be viewed (via the indicator lights on the console) or to to be loaded with some value via a second setting of the bit switches and much manipulation of the console. Nevertheless their state could be determined by a suitable machine code routine arranged so as to be callable from a compiler language such as fortran, and so a running programme might modify its behaviour - change the amount of progress information printed, alter the tactics of a multi-variable optimisation attempt, and so on. The IBM 1130 also had an "Interrupt Request" key associated with the console printer, whose pressing might cause a suitably programmed long-running programme to type a progress report on the console printer. In the more usual batch job environment, it was pressed by the computer operator to signal the operating system to terminate a running programme that had perhaps overrun its allowed time, or commenced misbehaviour such as repeatedly printing blank lines.
With the introduction of personal computers where the user is once again in attendance of the computer instead of being walled off by a batch-job arrangement, the user would once again be able to adjust switches but alas there are no longer sense switches attached to the computer to adjust. However, in a typical "windowing" environment a running programme will not have total control of the entire computer but will employ the facilities of the operating system to offer arrangements such that with the mouse pointer in certain locations a collection of options is presented whose state can be changed via mouse clicks or similar interaction, and, all going well, the running programme will modify its behaviour in response. Thus, the fixed allocation of hardware sense switches has been replaced by a presentation of options tailored for each application.
A typical running application has two modes: either it has nothing to do and awaits some user action which will trigger some work that will be completed in a blink (so reverting to waiting for further user provocation), or, some action is in progress that will take minutes, hours, days weeks, or more (for example, a stage in the search for Mersenne Primes), and during this time the programme should be responsive to interaction, but may not. Likewise, a programme on the IBM 1620 could dwell in an area that contained no tests of any sense switches, as that possibility had not been anticipated.
Wikimedia Foundation. 2010.