Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: evans@zk3.dec.com (Marc Evans)
Subject: Re: DECs commitment to UNIX ?
Date: Wed, 13 May 1992 20:28:38 GMT	[thread overview]
Message-ID: <1992May13.202838.3068@decvax.dec.com> (raw)
In-Reply-To: 1992May13.181504.23140@decuac.dec.com

In article <1992May13.181504.23140@decuac.dec.com>, mjr@hussar.dco.dec.com (Marcus J. "will do TCP/IP for food" Ranum) writes:
|> pavlov@niktow.canisius.edu (Greg Pavlov) writes:
|> >  Do you have a similar facility for ULTRIX people ?  How about some equivalent
|> >  (pseudo-equivalent) effort from DEC up front, whereby I could move a direc-
|> >  tory full of source from a MIPS/ULTRIX to an ALPHA/OSF 1 machine and execute
|> >  make with an "ULTRIX" flag ?  Too much work ??  More than it took to build a
|> >  translator for VMS ???
|> 
|> 	Porting between OSF/Alpha and OSF/MIPS and ULTRIX/MIPS should be
|> about as hard as recompiling applications was between a machine running
|> 4.1 and 4.2, unless your code is assembler or something like that. The
|> compilers are all there and they're the same frontends. What more do
|> you need?

For those of you that are would like to look through your code to see what
(if any) gotcha's you may bump into in porting source code from Ultrix 4.2
to DEC OSF/1 for ALPHA, here is a list of issues to watch out for:

By paying careful attention to data types you can make your code work
on both 32 bit and 64 bit systems.

C compiler data types and bit sizes are as follows:

			Mips 32 bit	Alpha 64 bit
	C type		Data Size	Data Size
	======		=========	============
	short		16 bits		16 bits
	int		32 bits		32 bits
	long		32 bits		64 bits
	* (ptr)		32 bits		64 bits

Declare any variable that you want to be 32 bits in size, as an "int",
not a "long".  That way it will be 32 bits in size on both 32-bit mips
systems and 64-bit Alpha systems.

If a variable should be 32 bits in size on a 32-bit mips system and
64 bits in size on a 64-bit Alpha system, then declare it as a "long".

Watch out for arguments to functions where the argument is not
explicitly declared (and typed).  You should explicitly declare the
formal parameters to routines or their sizes may not match up with the
caller (default is "int" which truncates 64-bit addresses).

Remember that "register var" and "unsigned var" default to "int" (32-bits).

Look at any variable declared "int".  It may be used to hold an address!
Sizeof (int) does not equal sizeof (char *) on Alpha.

Look at any variable declared "long".  If it must be 32 bits, then you
have to change its type to "int".

Constants are 32-bit quantities by default.  Shift operations or bit
operations on constants will give 32-bit results.  If you want a 64-bit
result you must follow the const with an "L", otherwise you get a
32-bit result.  For example:

	long foo, bar;
	foo = 1L << bar;

Using a "0" where you should use "NULL" means that you get a 32-bit const.
On alpha that could mean 0 in the low 32 bits and garbage in the high 32 bits.
Using "NULL" from stdio.h will get the correct value for mips and alpha.

Modifying a "char" is NOT atomic on Alpha.  You will get a load of 32
or 64 bits and then byte operations to extract, mask, and shift the
byte, followed by a store of 32 or 64 bits.

Bitfields declared as "int" on Alpha  generate load/store long (32 bits)
Bitfields declared as "long" on Alpha generate load/store quad (64 bits)

Printf formats: %d and %x will print 32 bits worth of data.
Use %ld and %lx to get 64 bits.

- Marc


  reply	other threads:[~1992-05-13 20:28 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-05-11 17:28 DECs commitment to UNIX ? i14isa
1992-05-11 20:46 ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-12 15:54   ` Gregory M. Paris
1992-05-12 20:50     ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-13  1:04       ` Gregory M. Paris
1992-05-13  4:24         ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-16 13:58         ` Charles M Richmond
1992-05-12 16:09   ` Greg Pavlov
1992-05-12 20:36     ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-12 23:36       ` Ralph Becker-Szendy
1992-05-13  2:11         ` Mike Iglesias
1992-05-13  2:34         ` Bob Supnik
1992-05-14 19:27           ` ajv
1992-05-15 20:44             ` Frank Wortner
1992-05-15 20:59             ` Win Treese
1992-05-16  1:01               ` George Michaelson
1992-05-16  3:50                 ` Mike Iglesias
1992-05-17 13:53                 ` Bill Gunshannon
1992-05-17 16:29                 ` Win Treese
1992-05-17 19:29                 ` (Irrelevant?) point of fact (was Re: DECs commitment to ...) Robin Fairbairns
1992-05-18  6:46           ` DECs commitment to UNIX ? Thor Lancelot Simon
1992-05-14 12:40         ` jackson
1992-05-14 18:04           ` Tom Newark
1992-05-14 16:52         ` VMS on Alpha jeh
1992-05-13 15:09       ` DECs commitment to UNIX ? Greg Pavlov
1992-05-13 17:25         ` Frank Wortner
1992-05-13 18:15         ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-13 20:28           ` Marc Evans [this message]
1992-05-14  5:30             ` Portability of programs John T Kohl
1992-05-13 20:49           ` DECs commitment to UNIX ? jon reeves
1992-05-14 12:50         ` jackson
1992-05-13  5:47     ` Andrew Rutherford
1992-05-13 12:31       ` Steve Simmons
1992-05-13 18:14         ` Greg Pavlov
1992-05-13 19:19           ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-13 21:08           ` Steve Simmons
1992-05-13 15:48       ` Greg Pavlov
1992-05-14  0:53         ` Ken Spagnolo
1992-05-14 14:36         ` Douglas W O'Neal
1992-05-14 23:54         ` Andrew Rutherford
1992-05-16 14:19         ` Charles M Richmond
1992-05-18  9:21         ` Karl Kleine
1992-05-11 22:19 ` Reha Elci
1992-05-12  2:25   ` Neil Johnson
1992-05-12 10:53   ` Steve Thompson
1992-05-13  5:49   ` Douglas Miller
1992-05-13  5:55 ` Douglas Miller
1992-05-13  6:27   ` Michel Fingerhut
1992-05-13 12:38     ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-14  1:47     ` Douglas Miller
1992-05-13 12:47       ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-13 18:40         ` Greg Pavlov
1992-05-13 19:36           ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-15  8:05             ` DECs commitment to UNIX ? (I surrender ! sort of...) Greg Pavlov
1992-05-13 19:54         ` DECs commitment to UNIX ? Darrin Robinson
1992-05-13 13:00       ` James L Walker
1992-05-13 17:39       ` Greg Pavlov
1992-05-16 14:28         ` Charles M Richmond
1992-05-19  9:09           ` Michel Fingerhut
1992-05-19 17:03             `  Alan's Home for Wayward Notes File.
1992-05-19 17:56           ` Steve Simmons
1992-05-20  3:43             ` Charles M Richmond
     [not found]           ` <945@niktow.canisius.edu>
1992-05-20  6:39             ` Michel Fingerhut
1992-05-25  7:14         ` Douglas Miller
1992-05-26  1:51           ` Greg Pavlov
1992-05-16 13:34 ` Charles M Richmond
1992-05-16 22:09   ` Leo D. Geoffrion
1992-05-17  1:21     ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-17 11:31       ` Jack Churchill
1992-05-18 12:37       ` James L Walker
1992-05-18 12:59     ` Steve Simmons
1992-05-18 20:32     ` Tom Newark
1992-05-21 15:23     ` Matt Thomas
1992-05-22 11:17       ` dominique dierick 7548
  -- strict thread matches above, loose matches on Subject: below --
1992-05-12 13:02 Daryl Morse
1992-05-12 19:45 ` Ralph Becker-Szendy
1992-05-12 20:54   ` Frederick M. Avolio
1992-05-12 21:05   ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-13 15:33     ` Greg Pavlov
1992-05-15 14:55 ` D Trammel
1992-05-15 19:59   ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-15 22:52     ` Joel Gringorten
1992-05-16  1:05       ` Joel Gringorten
1992-05-22 13:30         ` Merton Campbell Crockett
1992-05-21 18:16 sharpe
1992-05-21 18:58 Eric Smith
1992-05-22  8:45 ` Robin Fairbairns
1992-05-22 11:41 ` Greg Pavlov
1992-05-26  7:56   ` Thaddeus P. Floryan
1992-05-26 19:43     ` Glenn Hollinger
1992-05-23  3:04 Mark Hittinger
1992-05-23  3:21 ` Marcus J. "will do TCP/IP for food" Ranum
1992-05-24 17:53 ` Reha Elci
1992-05-26  9:46   ` Michel Fingerhut
1992-05-28  7:53     ` Alex Martelli
1992-05-26 16:10   ` CP/M lives!
1992-05-26 18:22 ` Greg Vesper - RMS
1992-05-26 21:18   ` Tom B. O'Toole
1992-05-26 21:22     ` Steve Thompson
1992-05-27 22:04     ` William Pietri
1992-05-28  3:06       ` Jack Churchill
1992-05-28 17:07       ` Tom B. O'Toole
1992-05-29 13:50         ` Thaddeus P. Floryan
1992-05-28  6:45     ` Douglas Miller
1992-05-24  2:12       ` Bob Condon; x6303
1992-06-08 18:27         ` Mark Bartelt
1992-06-10 22:04         ` Hans Jespersen
1992-05-27 23:58       ` Harry Flowers
1992-05-28 16:34         ` CP/M lives!
1992-05-29 13:40       ` Thaddeus P. Floryan
1992-06-02  3:02     ` Carl J. Appellof
1992-05-27 12:58   ` Michael Schuster 8726004 (Prak1 Gerhard)
1992-05-27 15:17   ` Greg Pavlov
1992-05-27 21:47 ` William Pietri
1992-05-28  3:44 ` Mark Hittinger
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox