avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] inline asm problem


From: Christian Ludlam
Subject: Re: [avr-gcc-list] inline asm problem
Date: Fri, 13 Feb 2004 11:26:18 GMT
User-agent: Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.03) POPstar/2.05

On 13 Feb Clemens Buchacher wrote:

> On Thu, Feb 12, 2004 at 09:18:37AM +0800, whiteman wrote:
> [...]
> >        error message "pwm.c:27: error: impossible constraint in
> >        `asm'". what's meaning?
> > My inline asm is :
> >                     asm volatile("sbi 0,1" : "=I"(PORTC) : "I"(6));
> 
> The sbi instruction uses I/O register addresses, so you will have to use
> _SFR_IO_ADDR(PORTC) if PORTC is in this address range (see
> <avr/sfr_defs.h> for details). If it is not, you cannot use the sbi
> instruction at all.

Of course, with today's compilers, you should be able to replace this with

    PORTC |= 1<<6;
    
and do away with inline asm altogether.

-- 
Christian Ludlam
address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]