assembly - Storing values from special function registers to a variable -


i working on development project based on freescale mpc5534 controller.
requirement, need store values 2 special function registers(namely srr0 , srr1) during isr(already existing) variables can accessed out of function. following assembly code snippet existing isr:

lis r0,0x_value1 ori r0,r0,0x_value2 mfspefscr r3 , r0,r0,r3 mtspefscr r0  lis r3,address@h ori r3,r3,address@l mtlr r3 li r3,0x_value3 blrl rfi 

how planning store values registers in following manner:

lis r0,0x_value1 ori r0,r0,0x_value2 mfspefscr r3// move spefscr register , r0,r0,r3 mtspefscr r0 //move spefscr register lis r3,address@h ori r3,r3,address@l mtlr r3  mfsrr0 r4 //copy srr0 r4 mfsrr1 r5 //copy srr1 r5  li r3,fpu_reset blrl rfi 

what troubles me is, how know if registers r4 , r5 being used other functions already(say dont have access other project files)? if so, approach right? have explicitly create stack frame isr pushing , popping r4 , r5, make sure there won't register clash? make sense?

right not in position compile file , see.

anyone has worked freescale or powerpc in general might able me. in advance.

a quick search tells me need implement own stack frame in other parts in family (555x, 551x). didn't explicitly find reference 553x, should able find one.

this appnote referenced: an2865


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -