From mboxrd@z Thu Jan 1 00:00:00 1970 From: otto@drijf.net (Otto Moerbeek) Date: Sun, 18 Mar 2018 08:35:56 +0100 Subject: [TUHS] RIP John Backus In-Reply-To: <1881ddbc-690a-2901-a68e-91334322065d@kilonet.net> References: <1881ddbc-690a-2901-a68e-91334322065d@kilonet.net> Message-ID: <20180318073556.GC53333@clue.drijf.net> On Sat, Mar 17, 2018 at 02:52:29PM -0400, Arthur Krewat wrote: > On 3/17/2018 1:49 PM, Paul McJones wrote: > > It first ran on the IBM 704, whose index registers subtracted (as did > > the follow-on 709, 7090, etc), so array indexing went from higher memory > > addresses to lower. > > 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? > > ak Speculation: If you only have a conditional jump on zero, a loop that ends at an index becoming zero is more easy, it saves an extra subtraction to test for the end condition. You load the size of the array into the index register, and then loop until it becomes zero. If you then use the end the array as the base, you still have a forward loops since the effective address will be computed as end - index with index begin decremented in the loop. -Otto