[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] ASM in WinAVR GCC
From: |
Panther Electronics |
Subject: |
[avr-gcc-list] ASM in WinAVR GCC |
Date: |
Fri, 10 Jan 2003 08:31:57 +0530 |
Hi,
can this problem be solved?
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
#define trg 0
#define db_time 25
unsigned char mem_db;
unsigned char result;
unsigned volatile char temp, wreg;
unsigned char delays(unsigned char pin, unsigned char port);
int main(void)
{
for (;;)
{
temp= 0x01;
wreg =0x17;
wreg = delays(temp, wreg);
}
}
unsigned char delays (unsigned char pin, unsigned char port)
{
unsigned char __t;
asm volatile(
"nop" "\n\t"
"nop" "\n\t"
"mov %0, %1" "\n\t"
"out %2, %1" "\n\t"
: "=&r" (__t)
: "a,I" (pin), "a,I" (port)
);
return ( 0 );
}
>make all"-------- begin --------"
avr-gcc --version
avr-gcc (GCC) 3.3 20021209 (experimental)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
"Size before:"
text data bss dec hex filename
0 122 0 122 7a Dd.hex
avr-gcc -c -g -Os -funsigned-char -funsigned-bitfields -fpack-struct
-fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=Dd.lst -mmcu=at90s2313 -I.
Dd.c -o Dd.o
Dd.c: In function `delays':
Dd.c:37: error: operand constraints for `asm' differ in number of alternatives
make: *** [Dd.o] Error 1
>Exit code: 2
Thanks in advance
Srikanth Kamath T
PS any URL to check this out in depth; tried the GCC, it list all the
constrains but does not inform how to work arround.
avr-gcc-list at http://avr1.org
- [avr-gcc-list] ASM in WinAVR GCC,
Panther Electronics <=