avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] [avr-as]: How to assembler a 24-bit integer?


From: Georg-Johann Lay
Subject: [avr-gcc-list] [avr-as]: How to assembler a 24-bit integer?
Date: Sun, 30 Oct 2011 21:43:49 +0100
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Hi,

I need to assemble 24-bit integers in avr-as as if they were generated from C code like

        const __pgmx char c = 1;
        const __pgmx char *pc = &c;

where __pgmx generates 24-bit addresses.

If pc just held a 16 bit address the code was

        .global   pc
                .data
                .type   pc, @object
                .size   pc, 2
        pc:
                .word c

Now the question is: How to write down a 24-bit symbol?

        .global   pc
                .data
                .type   pc, @object
                .size   pc, 3
        pc:
                .word c
                .byte hlo8(c) ??? error from as

gives an error from the assembler, same for .byte hh8(c)

Moreover, a const-integer offset can be added to c:

                .word c+2
                .byte hlo8(c+2) ??? error from as

What is the right way to write it own?

Many thanks,

Johann




reply via email to

[Prev in Thread] Current Thread [Next in Thread]