What exactly the PC relative addressing in Cortexm4?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

What exactly the PC relative addressing in Cortexm4?

590件の閲覧回数
Eager0007
Contributor I

I have been working on LPC54608 controller which is powered by cortexm4.When i went into assembly language code , i noticed frequent usage of PC relative addressing for accessing global variables. I am confused why pc relative addressing when processor is able to handle 32bit data and addresses? 

Can some one give me a clarity for this?
Thanks in advance.

ラベル(7)
0 件の賞賛
返信
1 返信

561件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi @Eager0007 

Cortex M4 core can handle 32bit data and addresses.

But assembly code uses PC relative addressing, since PC relative addressing is more flexible, it relies on the current PC pointer address and doesn't need to modify absolut addresses in code.
Besides, PC relative addressing shortens the instructions, reduces the code space and enhances the efficiency.

Hope this helps,

Jun Zhang

0 件の賞賛
返信