[Top][All Lists]

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

[avr-gcc-list] Include ASM in C

From: Elmar Koch
Subject: [avr-gcc-list] Include ASM in C
Date: 8 Jun 2001 16:51:55 MET DST


maybe a stupid question, but ...

I'm new to AVR GCC and I'm trying to include some assembler instructions in my

When I do the following:

asm volatile("sbi 0x15,0x07;");

everything is OK!

but when I do the same but replacing the address of the port by its label

asm volatile("sbi PORTB,0x07;");

I get a compilation error: "Error: constant value required"

This happens even if I define a constant like:
#define MYPORTB 0x15
asm volatile("sbi MYPORTB,0x07;");

This is the same also with register labels.

Any idea on what I'm doing wrong?

Also, how can a pass variables into an assembler instruction. It seems that
only globally defined variables are recognized. Anybody can confirm this?

Thanks to all!


Get free email and a permanent address at http://www.netaddress.com/?N=1

reply via email to

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