Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!utfyzx!oscvax!rico From: rico@oscvax.UUCP Newsgroups: comp.sys.amiga Subject: Caveat for Manx C (3.20 and 3.40) Message-ID: <477@oscvax.UUCP> Date: Fri, 20-Mar-87 13:45:40 EST Article-I.D.: oscvax.477 Posted: Fri Mar 20 13:45:40 1987 Date-Received: Sat, 21-Mar-87 08:41:57 EST Distribution: net Organization: Ontario Science Centre, Toronto Lines: 54 Watch out for this: char a[65537]; int i; main() { for (i=0;i<65537;i++) a[i] = i; } This won't work no matter what memory model you used because the external storage is too big. Here's the assembler it generates (Manx 3.4, using +p): ;:ts=8 far code far data global _a,1 <--- this should be global _a,65537 !!! global _i,4 public _main _main: link a5,#.2 movem.l .3,-(sp) clr.l _i .6 move.l _i,d0 lea _a,a0 move.b _i+3,(a0,d0.l) <--- correctly uses long offset due to large .4 memory model add.l #1,_i cmp.l #65537,_i blt .6 .5 .7 movem.l (sp)+,.3 unlk a5 rts .2 equ 0 .3 reg d2/d3 public .begin dseg end This isn't too big of a disaster but I wish it would complain rather than just silently creating bad code... PS. I love the new 3.4 system, especially db and z. Thank's Jim! -Rico -- [NSA food: terrorist, cryptography, DES, drugs, CIA, secret, decode] [CSIS food: supermailbox, tuna, fiberglass coffins, Mirabel, microfiche] [Cat food: Nine Lives, Cat Chow, Meow Mix, Crave]