|
From: | Marco Randazzo |
Subject: | [avr-gcc-list] inline ASM newbie problem |
Date: | Mon, 10 Oct 2005 08:25:14 +0200 |
Hi, I'm new to asm inline programming.
I would like to pass a simple input value to an asm
routine but compiler says "error: impossible constraint in `asm'" and I can't
understand what I've to do. Here is my code:
uint8_t
servo_prot_offset;
[...]
asm volatile (
"\n" "PUSH R18" "\n\t" "PUSH R24" "\n\t" "PUSH R25" "\n\t" " LDI R24,0x00" "\n\t" " LDI R25,0x00" "\n\t" "l1 : ADIW R24,0x01" "\n\t" " LDI R18,0x06" "\n\t" " CPI R24,%0 " "\n\t" <--- HERE I WANT COMPARE R24 WITH THE VALUE OF servo_prot_offset
" CPC R25,R18
" "\n\t" );
" BRCS l1" "\n\t" "POP R25" "\n\t" "POP R24" "\n\t" "POP R18" "\n\t" : //output operands : "M" (servo_prot_offset) //input operands Thanks in advance,
Marco Randazzo
|
[Prev in Thread] | Current Thread | [Next in Thread] |