[comp.sys.atari.st] Reliable archiver/compress

Martin_Koehling@do.maus.de (Martin Koehling) (05/27/91)

Juergen Lock nox @ jelal.north.de:
<a5434559@jelal.north.de>

>and i first had similar problems. the reason was a bug in Turbo C:
>it didn't compile things like
>
>int x=30000;
>y=foo[x];
>
>(where foo is an int * or something, i.e. anything `bigger' than a
>char *), properly. (made it something like `move (a0,d0.w),d1', if
>you know what i mean...)
>
> to `fix', i had to cast virtually everything inside [] to long's,
>to make it use `move (a0,d0.l),d1' like it should. so for the line
>above that would mean
>
>y=foo[(long) x]; .
>
> hope this helps,
>        Juergen
>
>PS: to be fair, i don't know if the bug still is in TC's latest
>version (i only have 1.1), but if yes, at least you now know how
>to make the thing compile a working zoo. :-)

The bug was fixed in Turbo C version 2.00.
It wasn't really a bug but a "design restriction" - it made programs both
smaller and faster (it's even mentioned somewhere in the manual!).
The new compiler uses only 16 bits for array addressing if and only if it is
sure that the array addressed is smaller than 32 KBytes.
Otherwise all 32 bits are used...
Note that this is _not_ mentioned in the new manual; but it was one of the
first things I tried out when I got my 2.00 update... :-)

MfG,
    Martin