I have almost zero avr assembly knowledge. I am trying to use a simple .s file which was for a different compiler, in GCC. The original was this:
_LoadZ:: movw Z, r16 ; Load R17:R16 into Z. ret _LoadR0:: movw r0, r16 ; Load R17:R16 into R1:R0. ret _ReadELPM:: elpm r16, Z ret
I changed it to this:
.section .text .global LoadZ LoadZ: movw Z, r16 ; Load R17:R16 into Z. ret .section .text .global LoadR0 LoadR0: movw r0, r16 ; Load R17:R16 into R1:R0. ret .section .text .global ReadELPM ReadELPM: elpm r16, Z ret
and created this header file:
void LoadZ( unsigned int addr); void LoadR0(unsigned int addr); uint8_t _ReadELPM(uint8_t);
when I compile it throws an error that it was expecting a constant at
LoadZ:
I have tried a couple of changes but none worked. thanks