Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!cit-vax!usc-oberon!bacall!papa From: papa@bacall.UUCP Newsgroups: comp.sys.amiga Subject: Re: Portable "C" Code Message-ID: <2360@bacall.UUCP> Date: Sat, 4-Apr-87 22:44:06 EST Article-I.D.: bacall.2360 Posted: Sat Apr 4 22:44:06 1987 Date-Received: Wed, 8-Apr-87 06:37:46 EST References: <6082@amdahl.UUCP> Organization: CS&CE Depts, U.S.C., Los Angeles, CA Lines: 41 > From Robert Mitchell: > > Leo Schwab is one of the most creative and productive > people on the net. I really like what he did with > ROBOTROFF. > > Converting it to Lattice, however, was painful. > Porting software between compilers within the Amiga > architecture can be (relatively) easy if authors > follow some basic guidelines. > There seem to be two primary problems in the Manx-to-Lattice > (or vice-versa) translation: > > 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 Lattice, all is easy since sizeof(int)=sizeof(long)= 32bits. With MANX it depends on the model used. Using the model with 32-bit ints, one gets larger code, but retains compatibility with Lattice. Using the model with 16-bit ints, one has to cast ints to longs when passing parameters to ROM kermel routines. Also one has to add the letter L to EVERY constant that is passed, since by default constants are of type int in C. -- Marco Papa -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 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 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-