General purpose register

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

General purpose register

594件の閲覧回数
abdelrhman
Contributor III

Hi all,
I'm using s32 IDE for programming MPC5744p microcontroller.
How can I store the value of a register directly to a memory address using assembly code??

 

0 件の賞賛
返信
1 返信

581件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @abdelrhman 

SPR registers can be read/write using these macros:

https://community.nxp.com/t5/S32-Design-Studio/Read-PowerPC-Machine-State-Register-from-C/m-p/160022...

 

And here is minimalist code showing how to store content of r10 to RAM address 0x40001000:

__asm("e_lis      %r3, 0x4000");

__asm("e_or2i  %r3, 0x1000");

__asm("e_stwu %r10, 0x0(%r3)");

Regards,

Lukas

0 件の賞賛
返信