Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!ll-xn!cit-vax!usc-oberon!bacall!papa From: papa@bacall.UUCP Newsgroups: comp.sys.amiga Subject: Re: Portable "C" Code Message-ID: <2368@bacall.UUCP> Date: Wed, 8-Apr-87 14:35:46 EST Article-I.D.: bacall.2368 Posted: Wed Apr 8 14:35:46 1987 Date-Received: Sat, 11-Apr-87 14:48:15 EST References: <8704071939.AA09157@cory.Berkeley.EDU> Organization: CS&CE Depts, U.S.C., Los Angeles, CA Lines: 51 > > > >> From Robert Mitchell: > >> 1) Manx defaults to 16 bit integers and Lattice uses 32 bit. > >> 2) Assembly language subroutines in Manx expect 16 bit > >> integer parameters, while Lattice promotes to 32 bit. > > > >This is not true. What you call assembly language subroutines are actually > >the Amiga library routines. These have ALWAY expected 32 bits for their > >parameters. So, no matter which compiler and model you use, you must pass > >32-bit paramters to them. There is never a problem when passing pointers, > >since they are always 32-bits. The problem comes when passing ints. With > >-- Marco Papa > > You misinterpreted Robert's comment, Marco. He was *NOT* talking > about the assembly interface to the Amiga library, he was talking about > assembly support routines that many people write for their programs. Those > people who are used to Manx w/16bit ints write their assembly routines > expecting short's for int's on the stack whereas somebody writing assembly > for Lattice or Manx-32bit would always expect long's for ints on the stack. > > -Matt True and not true. Robert says that "Assembly languages subroutines in MANX expects 16 bit integers", and you are saying that this is true only for people "who are used to MANX w/16bit" not "Manx-32bit". This was basically my point. Assembly language routines expect what you tell them to expect. Going back to "C" portability, Thomas Plum in his "Writing Portable C Programs" tutorial at the USENIX 1986 conference gives the following suggestions: Some practical guarantees: char 8 bits (or more) short 16 bits (or more) long 32 bits (or more) int no guarantee use these types in preferences to int -- Marco -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Marco Papa 3175 S. Hoover St., Ste. 275 (213)747-8498 Los Angeles, CA 90007 USC: (213)743-3752 F E L S I N A Now working for ::::::: BIX: papa But in no way :: :: Officially representing ::::::: ...!usc-oberon!bacall!papa S O F T W A R E papa@usc-cse.usc.edu -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-