This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM: asm variable initialization

Hi

Im using a STM32F429ZI and have the folowing problem:

In my assembler program i initialize the following variables:

                AREA myVars, DATA, READWRITE

op1_table       DCW     0x0001, 0x0017, 0xffff, 0x73a4, 0x43cc, 0xe372, 0xdd22, 0x7fff
op2_table       DCW     0xffff, 0x0004, 0xffff, 0x4c28, 0xc3bf, 0x0234, 0xbcde, 0x7fff

Then i want to acces them:

                AREA myCode, CODE, READONLY

                THUMB

main            PROC
                EXPORT main

                LDR  R0, =op1_table
                LDR  R1, =0xff
                LDRH R2, [R0, #0]           ; After this R2 contains 0xbe (should be 0x1)
                STRH R1, [R0, #0]
                LDRH R2, [R0, #0]           ; After this R2 contains 0xff (as it should)

I can write and read from the variable, but they're not initialized as the suposed to be (with the DCW directive).

What am i missing? I wrote a c example with global variables and couldn't find a difference...

Parents Reply Children
No data