From Sun, 14 Feb 2010 11:12:03 +1100 Erik Christiansen <dva...@internode.on.net> wrote:
> If you have no objection to each message having global labels, it is > not only achievable (via the ldi or ldd relocations), but the need to > store the string length is avoided: > > .section .text > > ; In the code somewhere, we compute the length when it's needed: > ldi r16,(end_msg1 - msg1) > ; or, depending on needs: > ldd r20,Y+(end_msg1 - msg1) > > msg1: .ascii "somestring" > end_msg1: > > Does that come close enough to meeting your needs? Unfortunately, I can't imagine how this would help me. Well, to be concrete, I'm implementing a simple FORTH virtual machine. A FORTH "word" (it's what we call subroutines in other programming languages) begins with a header, and this header contains the length of the name (in fact, the length is contained in lower 5 bits, upper 3 bits are reserved for various flags) before the name itself. This all works on x86 and x86_64 just fine, problem arised when I've tried to port it to avr. I can try to make a binutils patch, but I'm not even sure whom I need to contact to push the patch upstream. -- Andrew
signature.asc
Description: PGP signature
_______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list