On 3/17/2018 12:22 PM, Arthur Krewat <krewat(a)kilonet.net> wrote:
Leave it to IBM to do something backwards.
Of course, that was in 1954, so I can't complain, it was 11 years before
I was born. But that's ... odd.
Was subtraction easier than addition with digital electronics back then?
I would think that they were both the same level of effort (clock
cycles) so why do something obviously backwards logically?
Subtraction was done by taking the two's complement and adding. I
suspect the CPU architect (Gene Amdahl -- not exactly a dullard)
intended programmers store array elements at increasing memory
addresses, and reference an array element relative to the address of the
last element plus one. This would allow a single index register (and
there were only three) to be used as the index and the (decreasing)
count. See the example on page 97 of:
James A. Saxon
Programming the IBM 7090: A Self-Instructional Programmed Manual
Prentice-Hall, 1963
http://www.bitsavers.org/pdf/ibm/7090/books/Saxon_Programming_the_IBM_7090_…
The Fortran compiler writers decided to reverse the layout of array
elements so a Fortran subscript could be used directly in an index register.