What is non-aligned access? (ARM/Keil)

前端 未结 5 1818
抹茶落季
抹茶落季 2020-12-16 05:49

I\'m using Keil to write Assembly for ARM 7.

I have the following runtime error:

Non-aligned Access: ARM Instruction at 000000F8H, Memory Access at 7         


        
5条回答
  •  时光说笑
    2020-12-16 06:27

    check the data type.

    eg Suppose you have declared an array as unsigned int V1[25][25]; and you have extern it as extern int (*V1)[22];

    suppose you are using function that returns this as,

    unsigned long func()
       {`unsigned long k;
          return (V1[0][0]+k);   //you will get an error.'
    
       }
    

    to avoid this use same data type in extern as extern unsigned int V1[25][25].

提交回复
热议问题