Path: utzoo!utgpu!watmath!watcgl!watmum!javoskamp From: javoskamp@watmum.waterloo.edu (Jeff Voskamp) Newsgroups: comp.arch Subject: Re: 80486 vs. 68040 code size [really: how many regs] Message-ID: <9819@watcgl.waterloo.edu> Date: 19 May 89 23:53:59 GMT References: <948@aber-cs.UUCP> <8125@killer.Dallas.TX.US> <427@ssp2.idca.tds.philips.nl> Sender: daemon@watcgl.waterloo.edu Reply-To: javoskamp@watmum.waterloo.edu (Jeff Voskamp) Distribution: eunet,world Organization: U. of Waterloo, Ontario Lines: 33 In article <427@ssp2.idca.tds.philips.nl> pb@idca.tds.PHILIPS.nl (Peter Brouwer) writes: >In article <8125@killer.Dallas.TX.US> elg@killer.Dallas.TX.US (Eric Green) writes: >>But there's one problem: Types. On a 68000, shorts and ints are 16 >>bits, longs are 32 bits. What this means is that if I declare a >Are you sure this is correct? The compilers I have used work with shorts as >16 bits ( word ) and ints and longs as 32 bits ( long word ). The situation you >describe is used on the 8086 family as far as I know. ( Lattice c on MSDOS ). Actually it depends on which machine you're working on. Most compilers that I know of for the Amiga, Mac and Atari ST are as described above (original article), although some will use 32 bit regular ints with the right options. Don't forget that while comparisons, moves, logical operations and simple math (addition and subtraction) work equally well on byte, word and long word quantities the higher math functions (multiplication and division) work partially with word values. Multiplication is 16 bits by 16 bits giving 32 bits while division is 32 bits divided by 16 bits giving 16 bit remainder and quotient (1). Therefore a "lazy" compiler will default to 16 bit quantities. Pointers are of course 32 bits. Great way to find out about "the world is a VAX" syndrome. :-) Jeff Voskamp (1) this is for a "vanilla" 68000. Mileage may vary with other members of the 680x0 processors. It looks like we're in Trouble. No, I'm in trouble - you're invincible. - My Secret Identity bang path: ...{!uunet}!watmath!watmum!javoskamp domain : javoskamp@watmum.uwaterloo.ca or javoskamp@watmum.waterloo.cdn