General purpose register

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

General purpose register

492 Views
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 Kudos
Reply
1 Reply

479 Views
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 Kudos
Reply