|
From: | Niklas Lövgren |
Subject: | RE: [avr-gcc-list] inline ASM newbie problem |
Date: | Tue, 11 Oct 2005 13:28:43 +0200 |
Hi again! Using the “l” constraint might
solve the problem… The following: 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" " CP R24,%0 "
"\n\t" " CPC R25,R18 "
"\n\t" " BRCS l1"
"\n\t" "POP R25"
"\n\t" "POP R24"
"\n\t" "POP R18" "\n\t" : //output operands : "l" (servo_prot_offset)
//input operands ); Generates: … LDI R24,0x00
LDI R25,0x00 l1 : ADIW R24,0x01 LDI R18,0x06 CP R24,r15 CPC R25,R18 BRCS l1 … Please note I haven’t thought thru
what you’re trying to do so it might be awfully wrong! /niklo From:
address@hidden
[mailto:address@hidden On Behalf Of Marco Randazzo 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 (
" CPC
R25,R18 " "\n\t" ); Thanks in advance, Marco Randazzo |
[Prev in Thread] | Current Thread | [Next in Thread] |