mardi 26 juillet 2016

impossible constraint in asm while compilation

In my Atmel ASF project, I am trying to build following inline asm code. However I am getting impossible constraint while compilation.

Compiler points to this line __asm__ __volatile__, am I missing anything?

#define OUTPORT PORTD
#define OUTBIT 3      // PD.3   
uint8_t rport ,rbits;
uint8_t *buf = message;
asm volatile(   "in     __tmp_reg__, __SREG__             nt" // 1  Save SREG for later
                "cli                                      nt" // 1  Clear interrupts
                "in     %[rport], %[port]                 nt" // 1  Move PORTB adress to rport

                : //Outputs
                [rport] "=&r" (rport)

                : //Inputs
                [port]    "I" (_SFR_IO_ADDR(OUTPORT))     // Adress to port register, 6-bit positive constant

                : //Clobber list (compiler must restore)

                "r0"                                       // This is __tmp_reg__
);
  1. What is destroying this build?
  2. I wonder if asm syntax is incorrect? I have been following this manual

Aucun commentaire:

Enregistrer un commentaire