Article View: comp.arch
Article #103Re: two's complement and Flags (Re: arithmetic and endian history)
From: Anton Ertl
Date: Wed, 14 Oct 2026 07:50
Date: Wed, 14 Oct 2026 07:50
36 lines
2842 bytes
2842 bytes
Thomas Koenig <tkoenig@netcologne.de> writes: >John Levine <johnl@taugh.com> schrieb: >> Either way, the fact that Fortran stored its arrays backwards >> suggests that whatever they had in mind turned out not to be useful. > >It certainly makes sense for a language like Fortran to store the >arrays on the order for the indexing. Putting in the arrays in >ascending order, with code like > > DO 10 I=1,10 > A(I) = B(I) + C(I) > 10 CONTINUE > >would have required negating the index registers for the array >indices. Given that FORTRAN was developed for the IBM 704, it's interesting that they did not design their loops to count down. Although, thinking about it some more, storing the arrays backwards is easier than storing them forwards, using and incrementing implementation for a counter that semantically decrements, and indexing the arrays with that counter, and converting the counter to the semantic value when using it in a non-indexing context. Another more hardware-centric way would have been to actually specify the arrays to have indexes from -N to 0 or so and to let A(I) access the element with index -I. But I guess that that would have run counter to the intention of "Formula translator", and storing the arrays backwards is actually easier than explaining these semantics in the manual, and letting the prorgammers work around it. - anton -- 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.' Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Technical Details
Message-ID:
<2026Oct14.095054@mips.complang.tuwien.ac.at>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<10uks4f$1dqo$1@gal.iecc.com> <865wzfm8ph.fsf@linuxsc.com> <11a3at4$17uu$1@gal.iecc.com> <86qzhvi9vn.fsf@linuxsc.com> <11aj5su$29p$1@gal.iecc.com> <11am9g1$uql2$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.arch Subject: Re: two's complement and Flags (Re: arithmetic and endian history) Date: Wed, 14 Oct 2026 07:50:54 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 36 Message-ID: <2026Oct14.095054@mips.complang.tuwien.ac.at> References: <10uks4f$1dqo$1@gal.iecc.com> <865wzfm8ph.fsf@linuxsc.com> <11a3at4$17uu$1@gal.iecc.com> <86qzhvi9vn.fsf@linuxsc.com> <11aj5su$29p$1@gal.iecc.com> <11am9g1$uql2$1@dont-email.me> Injection-Date: Wed, 14 Oct 2026 08:02:26 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1317364"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zjW3hloSFubJSaRyXmgqf"; posting-host="4798f8a33d7cba4f1cfb66046bec21f9" Cancel-Lock: sha1:wp3x9d4PtJkvYZqVzc5mGSosvmI= sha256:UK8cfm6mqJu3YglDLIvEyzoE6iq2gR3z9ZMBjnBFQfE= sha1:kTYRolANz+TjraUI6CL/RLwALag= sha256:R7nowoQBnNpYr1QGVq0LUbIZQkI8J+8czB2J8dtfhxg= X-newsreader: xrn 10.11