[Icc-430] Reading MSP-430 status register from C....

llchisho at paradise.net.nz llchisho at paradise.net.nz
Mon May 5 15:45:04 PDT 2008


If somebody is working on the %<name> asm statement mechanism, is it possible to
have the mechanism extended to fields in structs (and maybe array elements
indexed by constant expressions if you're keen :-) ?

We have a message structure where a number of fields need to be byte reversed
for the CPU, and we have to use constructs like :
	asm("swpb %new_timings+4");
rather than
	asm("swpb %new_timings.leader");
with the risk of mis-calculating a field offset.

There was mention in the archives of a byte swap intrinsic not being needed as
an x=(x<<8)|(x>>8) construct would be automatically compiled to a swpb.
This does happen for register variables, but trying to do it to a global
variable results in 4 instructions using 2 temporary registers (using a + rather
than a | results in 8 instructions).



More information about the Icc-430 mailing list