Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!rutgers!cbmvax!amix!skrenta From: skrenta@amix.commodore.com (Rich Skrenta) Newsgroups: alt.religion.computers Subject: Re: Shoulds arrays start at zero or one? Message-ID: <289@amix.commodore.com> Date: 17 Jan 90 18:56:12 GMT References: <684@cditi.UUCP> Distribution: na Organization: Commodore Amix Development Lines: 24 In article <684@cditi.UUCP> josh@cditi.UUCP (Josh Muskovitz) writes: > Obviously, none of the "arrays should begin with 1" people have ever done ANY > serious assembly programming for any processor. Why should all the constraints of assembly programming be forced on me when I use a high level language? If I'm using one it's so I can get *away* from assembly and have the compiler take care of some of the details for me. > Now, even if you find that difficult to believe, what about that wasted > element you get when the compiler (shudder) forces element 0? I can't imagine any compiler forcing an element. Only Pascal programmers do that when they switch to C :-) Why won't this work: b data 100 # storage for array b_base equ 1 # starting index of array b_addr equ b - b_base # base address for array Where's the inefficiency? What will go wrong with my pointer arithmetic? Rich