byte access in MC68k

Mark Phillips M.S.Phillips@nortel.co.uk
Thu Jun 19 10:09:00 GMT 1997


Setting an attribute might force a particular width access for a
particular var:-
__attribute__ ((mode (word)))

but then again it might not....

I am fairly sure fiddling with the preprocessor will make no difference
(by the time gcc parses the text 0x0012 is the same as 0x12).

Why can't you use byte ops? Does it only apply to particular h/w registers
or to all memory?

Good Luck
Mark


Mark S. Phillips        ESN 742 2461
msp@nortel.co.uk        Tel. +44 1279 402461

On Thu, 19 Jun 1997, Jens Doege wrote:

> 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

This looks like a normal local variable access, is your main memory
broken, or just some h/w registers?

> 
> 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