byte access in MC68k

Brett Carswell brettc@tritro.com.au
Sun Jun 22 16:51:00 GMT 1997


Jens,

What about changing your #define to

#define SW_SRI	(short)(0x00f0)

I think this would have the desired effect.

Good Luck,
--------------------------------------------------------
Brett Carswell		Ph:  +61 7 3252 9722
Software Engineer		Fax: +61 7 3253 1403
Tritronics (Australia)	Email: brettc@tritro.com.au




>-----Original Message-----
>From:	Jens Doege [SMTP:doege@ljk.atsugi.asahi-kasei.co.jp]
>Sent:	Thursday, June 19, 1997 9:35 PM
>To:	crossgcc@cygnus.com
>Cc:	doege@ljk.atsugi.asahi-kasei.co.jp
>Subject:	byte access in MC68k
>
>Hi again,
>
>I want to thank Doug Evans for his instant answer to my previous
>question. I have another one:
>
>Is there a switch for gcc (68k) to force it not to use byte (char)
>operations?
>(I couldn't find something like this)
>
>All the variables I use are at least short. Nevertheless the compiler
>detects that from some variables just the lower byte is used:
>
>	if((ist & SW_SRI) != SW_SRI){...}
>
>In the ready code 
>
>	move.b -11(%a6),%d0
>	and.b #128,%d0
>	tst.b %d0
>
>odd memory addresses are accessed which causes really big trouble for my
>system. In the given case the preprocessor reduces
>
>        #define SW_SRI 0x00f0
>
>to just 0xf0. A precompilier switch to prevent that whould also be
>possible. 
>
>Thanks in advance
>
>Jens



More information about the crossgcc mailing list