About GCC-ARM assembler

김수진 sujin@compiler.kaist.ac.kr
Mon Oct 21 09:07:00 GMT 2002


Hello!  I have a question.
I don't understand this.

I want to use this instruction , ldr __a1, |dummy.0| 
, instead of these instructions 
  ldr     __a4, |L..7|
  ldr     __a1, [__a4, #0]    

This code, ldr __a1, |dummy.0| work well in SDT simulator. 

Why GCC access this variable indirectly?
-------------------------------------------------------------
        IMPORT  |__main|
        AREA |C$$data1|, DATA
        ALIGN
|dummy.0|
        KEEP |dummy.0|
        DCD     0

        AREA |C$$code2|, CODE, READONLY
        ALIGN
        EXPORT  |main|
|main|
        ....

        ldr     __a4, |L..7|
       ldr     __a1, [__a4, #0]       (why?)
        
        ....

        ldmea   __fp, {__fp, __sp, __pc}^
|L..8|
        ALIGN
|L..7|
        DCD     |dummy.0|
        IMPORT __main
        DCD __main
        END
--------------------------------------------------------------------------


More information about the Gcc-help mailing list