I am having some problems with the AVR version of the GNU assembler that you install with the Atmel tools. I have not encountered any of these problems with any other version of the GNU assembler. Until I have resolved these issues (these are BUGS in this version of the GNU assembler) I am basically stalled. I need a viable work around...
I have a macro that lays down a string with a leading count byte. The macro is as follows
.macro string str
.byte 9f - (. + 1)
.balign 2, 0
I have a work around for this but it is a major PITA. I just need to pass in the length of the string to the macro so ... 400+ strings in my sources and i have to count the length of every single one by had. STUPID!
This macro works flawlessly on the X86 version of the GNU assembler that comes with my Linux installation and with the Linux installation I put on my BeagleBoad-XM (ARM). I have used this macro for years without problem. The AVR version of the assembler pukes on it because the address "9f" (forward reference to a local label) is too big to fit in a byte. err seriously? Im not storing an address, im storing a delta between two addresses which is GUARANTEED to be less than 64 bytes.
1f is an address and is 24 bits so we cant stuff that in a 16 a 16 bit .int data type. If i make it a ".long 1f" then the assembler pukes on not being able to write 32 bit values into the 16 bit memory addresses in .text. I could modify my code to expect a delta but again 1f - (.+1) wont fit here because the delta is a 0x000000nn <-- 32 bit value that wont fit in a 16 bit .text cell.
Any help would be appreciated !