I'm trying to place pascal string like constants in flash (length byte followed by ASCII string with no trailing zero byte)
The following is failing with "Error: illegal relocation size: 1"
FOO: .byte ((BAR - . - 2) & 0x7F) ; calculate length .ascii "foo" BAR: .word 0x1234 ; dummy for this example
I could just hard code the length, except I have eventually want this in a macro as I have several hundred string.
I assume the error is because ((BAR - . - 2) & 0x7F) resolves to a two byte type even although we can see its value would always fit within a byte.
I tried using lo8() but it appears not to be recognised within this context - Error: junk at end of line, first unrecognized character is `('.
It didn't seem a particularly unusually thing to want to do so I'm hoping someone can point me in the right direction with this.