Newsgroups: comp.sys.transputer
From: wgd@ukc.ac.uk (Warren Day)
Subject: Re: An occam query
Organization: University of Kent at Canterbury, UK.
Date: Wed, 15 Jun 94 11:49:20 GMT
Message-ID: <9457@eagle.ukc.ac.uk>

In article <771622706snz@aiki.demon.co.uk> jdd@aiki.demon.co.uk writes:
>    INT ValInPacket RETYPES [packet FROM offset FOR 4]:

I was trying to avoid saying 4 explicitly.  One way to do this is,

	VAL an.int IS 0:
	VAL []BYTE an.int.in.bytes RETYPES an.int:
	VAL bytes.per.int IS SIZE an.int.in.bytes:

Thanks to Nathan at Inmos for this approach.  This doesn't appear work on my
1988 compiler though (or not when your trying to put it in a library anyway).

I have resulted to,
	VAL bytes.per.int IS 4:  -- 32 bit processors ONLY

This isn't wonderfully nice, but I suspect I won't be changing it for some
time.  When I do I'll have a newer compiler anyway...  :)

>this address is not guaranteed to be aligned.
>The transputer ignores the two low order address bits

Worth bearing in mind.  My offset is always 0 so and I have had no problems.

>Jim
--
Warren
		Pause for a moment,
			and consider man's humanity towards his fellow man.

