[TUHS] origin of string.h and ctype.h

Paul Winalski paul.winalski at gmail.com
Tue Aug 15 02:09:54 AEST 2017


On 8/13/17, Paul McJones <paul at mcjones.org> wrote:
> On Sun, 13 Aug 2017, Dave Horsfall wrote:
>
>> On Sat, 12 Aug 2017, Steve Johnson wrote:
>>
>>> A little Googling shows that the IF I mentioned was called the
>>> "arithmetic IF".
>>
>> Ah yes.  It was in FORTRAN II, as I recall.

The FORTRAN II arithmetic IF, with its three-way branch, was probably
introduced to facilitate use of the conditional branch instructions of
the IBM 704, which test the value of the accumulator and take a branch
accordingly:

    TMI (transfer on minus)
    TMP (transfer on plus)
    TZE (transfer on zero)
    TNZ (transfer on not zero)

It takes at most two of these instructions to implement the arithmetic IF.

-Paul W.
>
> It turns out the original FORTRAN (manual published in October 1956; code
> first shipped around April 1957) included the arithmetic IF as well as the
> assigned and computed GOTO statements — see chapter 4 of this manual:
>
> J.W. Backus, R.J. Beeber, S. Best, R. Goldberg, H.L. Herrick, R.A. Hughes,
> L.B. Mitchell, R.A. Nelson, R. Nutt, D. Sayre, P.B. Sheridan, H. Stern, I.
> Ziller. The FORTRAN Automatic Coding System for the IBM 704 EDPM :
> Programmer's Reference Manual. Applied Science Division and Programming
> Research Department, International Business Machines Corporation, October
> 15, 1956, 51 pages.
> http://www.bitsavers.org/pdf/ibm/704/704_FortranProgRefMan_Oct56.pdf
>
> (For more on the original FORTRAN compiler, see
> http://www.softwarepreservation.org/projects/FORTRAN/.)


More information about the TUHS mailing list