Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!bagate!cbmvax!cbmehq!cbmdeo!jsmami!jsmoller From: jsmoller@jsmami.UUCP (Jesper Steen Moller) Newsgroups: comp.sys.amiga.programmer Subject: Re: > SAS gripes (was DICE vs GCC) Message-ID: <18f1e3ae.ARN128f@jsmami.UUCP> Date: 6 Apr 91 19:33:06 GMT References: <9104021420.AA10848@thunder.LakeheadU.Ca> <1991Apr4.034920.16298@marlin.jcu.edu.au> <1991Apr4.180217.19773@nntp-server.caltech.edu> <1991Apr5.030228.28756@marlin.jcu.edu.au> <1991Apr5.173845.4404@nntp-server.caltech.edu> <20421@cbmvax.commodore.com> Reply-To: cbmehq!cbmdeo!jsmami!jsmoller (Jesper S. Moller) Followup-To: comp.sys.amiga.programmer Organization: Danish SofTech Lines: 51 In article <20421@cbmvax.commodore.com>, Randell Jesup writes: > In article <1991Apr5.173845.4404@nntp-server.caltech.edu> tll@nntp-server.caltech.edu (Tal Lewis Lancaster) writes: > >cpca@marlin.jcu.edu.au (Colin Adams) writes: > >> Because I am doing things that just can't be done with SAS or Aztec. > > > >>Why not? > > > >Well the main reason is I am creating object files greater than 32K (actually > >some are around 80K). SAS and Aztec can not handle object files > 32K. Or to > >be more precise a function call to another function in the same object file must > >be < 32K apart. > > Easy, just use -r0 to turn off pc-relative bsr's (-b0 to use long > data addressing). Not easy, unfortunately. The branches aren't correct (in fact, the compiler will produce some utter crap if the branches exceed 32k). -b0 will turn JSR xx(pc) into JSR xx, but only for outside functions... To optimize, the compiler changes all jsr's to BRA.(B|W), somthing it's done ever since version 3.03. These BSRs are not affected by -r0 or -r1... A bug to me... To prove that, I made a file of: void f1() {f1();} void f2() {f1();} void f3() {f1();} void f4() {f1();} void f5() {f1();} /* etc... 8000 functions all in all */ And compiled with -r0 (with lc1b, lc1 simply can't do it...) And -v for lc2 of course... Try disassembling this (no go with OMD, but Matt's dobj does this just fine :) ). It's ok for the first 32k, but from there on, there's garbage instead (as a "text-section exceeds 32k, branches might be corrupt (or whatever) warns the user). The brances are wrong and there's garbage after them... Hope you don't rely on SAS/C too much... > Randell Jesup, Keeper of AmigaDos, Commodore Engineering. Greets, Jesper -- __ Jesper Steen Moller /// VOICE: +45 31 62 46 45 Maglemosevej 52 __ /// USENET: cbmehq!cbmdeo!jsmoller DK-2920 Charl \\\/// FIDONET: 2:231/84.45 Denmark \XX/