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

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

AW: [avr-gcc-list] asm question


From: Haase Bjoern (PT-BEU/EMT) *
Subject: AW: [avr-gcc-list] asm question
Date: Fri, 15 Jul 2005 09:28:46 +0200

The problem is almost certainly, that your function needs to use the Y register 
as frame pointer. In fact, IIUC, forcing values into the Y registers presently 
will fail almost always. Reload will not be able to handle this case.

Workaround, IMO, would be to use the X register and auto-increment instead.

Yours,

Björn 

-----Ursprüngliche Nachricht-----
Von: address@hidden [mailto:address@hidden Im Auftrag von Torsten Mohr
Gesendet: Donnerstag, 14. Juli 2005 22:33
An: address@hidden
Betreff: [avr-gcc-list] asm question

Hi,

i tried to write an inline asm function that gets two input parameters
in "Y" and "Z".  These two pointers should point to two uint32_t
locations in RAM and the asm function should copy from Y to Z
and while copying change the endianness of the copied value:

static __inline__ void store_be32_at32(uint32_t* dest, uint32_t* src) {
  asm volatile ("\t"
                "ld __tmp_reg__, Y+3\n\t"
                "st Z+0, __tmp_reg__\n\t"
                "ld __tmp_reg__, Y+2\n\t"
                "st Z+1, __tmp_reg__\n\t"
                "ld __tmp_reg__, Y+1\n\t"
                "st Z+2, __tmp_reg__\n\t"
                "ld __tmp_reg__, Y+0\n\t"
                "st Z+3, __tmp_reg__\n\t"
                :: "z" (dest), "y" (src)
                );

When i use this, i get the error message:

common_lib.h: In function `store_be32_at32':
common_lib.h:20: Fehler: in der Klasse »POINTER_Y_REGS« konnte \
während des Neuladens von »asm« kein Register gefunden werden

This roughly translates to:
In the class "POINTER_Y_REGS" no register could be found when
reloading >>asm<<.

I wonder about this error, according to avr-libc-user-manual-1.2.3
i can use Y and Z in the way i did.  The assembler commands also
seem to be correct to me.

Also, when i don't use Y and Z but %1 and %0, i get the same error.


Best regards,
Torsten.


_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list







reply via email to

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