[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] asm question
From: |
Torsten Mohr |
Subject: |
[avr-gcc-list] asm question |
Date: |
Thu, 14 Jul 2005 22:33:12 +0200 |
User-agent: |
KMail/1.8 |
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] asm question,
Torsten Mohr <=