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

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

[avr-gcc-list] ASM in avr gcc


From: Panther Electronics
Subject: [avr-gcc-list] ASM in avr gcc
Date: Tue, 7 Jan 2003 13:58:51 +0530

hi,

I was trying to use ASM in the avr-gcc landed into problems;

a) the compiler wants the passed variables to be in Register above R15, this i 
belive is done by declaring the the inputs as "d" or "a" but doing so effects 
the
b) cbi function it wants the passed vaiables in the range 0-63 "I"

what must i do so that the so that the passed variable is both "I" and also its 
loaded into Simple upper registers "a".

thanks in advance

Srikanth kamath t
PS: my e-mail to address@hidden does not come up in the list, but i get e-mail 
from other list members, what am i doing wrong?

--part of the code
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 = debounce ( 0x17, trg, db_time);*/
  /* debounce(portd, pin, time, dbmem, port, result)\*/
    temp = 0x01;
    wreg = 0x17;

  wreg = delays(temp, wreg);



  }
}


unsigned char delays (unsigned char pin, unsigned char port)
  {
    unsigned char cnt;
    asm volatile (
      "nop" "\n\t"
      "nop" "\n\t"
      "mov %0, %2" "\n\t"
      "out %2, %1"  "\n\t"
      /*"mov %0, %1"*/ "\n\t"
      : "=&d" (cnt)
       : "r" (pin),  /* I guess the problem is here but how can i make the port 
both "r" and "I" */
       "r" (port)
    );
    return (cnt);
  }

-- snap shot ---
"-------- 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.

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
C:\WINDOWS\TEMP/ccFBRegb.s: Assembler messages:
C:\WINDOWS\TEMP/ccFBRegb.s:103: Error: constant value required
make: *** [Dd.o] Error 1
>Exit code: 2


avr-gcc-list at http://avr1.org



reply via email to

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