General purpose register

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

General purpose register

595 次查看
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 回复

582 次查看
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 项奖励
回复