[TUHS] arithmetic IF (was origin of string.h and ctype.h)

Paul Winalski paul.winalski at gmail.com
Thu Aug 17 04:04:47 AEST 2017


On 8/16/17, Doug McIlroy <doug at cs.dartmouth.edu> wrote:
>>> the 709 added CAS
>
>> It was my understanding that the 704 had this instruction too
>
> Yes. It's in the manual.
>
> (I searched in vain for an online manual. A quick trip to the
> attic turned up the real thing in less time.)
>
> Doug
>
>From what I've been able to determine, FORTRAN came out shortly after
the IBM 704.  Undoubtedly both were under development at the same
time.  So the question is, was arithmetic IF put in FORTRAN to take
advantage of the CAS instruction, or was CAS added to the IBM 704
instruction set to provide hardware support for arithmetic IF?  Or
maybe neither?

According to the Wikipedia article on FORTRAN, CAS was usually not the
most efficient way to implement arithmetic IF anyway.  CAS takes up
four words of memory and takes three cycles to execute, whereas you
can do it in two words and two cycles with the transfer instructions.

-Paul W.



More information about the TUHS mailing list