Roberto Padovani wrote:
Hi all!
in <iomacros.h> i got these defs:
#define _BIS_SR(x) __asm__ __volatile__( "bis %0, r2" : :
"i" ((uint16_t)x) );
#define _BIC_SR(x) __asm__ __volatile__( "bic %0, r2" : :
"i" ((uint16_t)x) );
#define __bis_SR_register(x) __asm__ __volatile__( "bis %0, r2" : :
"i" ((uint16_t)x) );
#define __bic_SR_register(x) __asm__ __volatile__( "bic %0, r2" : :
"i" ((uint16_t)x) );
in the post "Constraints on inline asm operands" of 2005-01-20 the
author noted that the constraints "i" requires an immediate value
(i.e. a constant), otherwise an error is generated.
That's fine. So my question is: shouldn't the 3rd and 4th defs have
the constraint "r" ?
I mean, from their name I understand they were meant to operate
register to register, weren't they? Is that a copy-and-paste mistake
or is there a reason i can't get ?
For the moment I defined my own:
__my_bis_SR_register(x) __asm__ __volatile__( "bis %0, r2" : : "r"
((uint16_t)x) );
These macros exists with two different names for compatibility with
other tool chains for the MSP430. They are intended to be identical, and
I believe are correct as they stand.
Regards,
Steve