S12XDP512, CW4.5, GPAGE, interrupts

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

S12XDP512, CW4.5, GPAGE, interrupts

Jump to solution
2,810 Views
gravity
Contributor I
Hi,
 
Is there any way to get the compiler to push the GPAGE register when invoking functions or interrupts?
 
I'm am trying to increment a globally addressed variable from an interrupt, which is altering the GPAGE, and therefore crashing the rest of the code.
 
Cheers
 
M
Labels (1)
Tags (1)
0 Kudos
1 Solution
464 Views
CompilerGuru
NXP Employee
NXP Employee
Or alternatively, use the -CpGPAGE option.
-CpGPAGE=0x10

When this option is used, the compiler will generate the register save code for GPAGE in all interrupt functions, but only if the GPAGE could possibly be modified.

The #pragma TRAP_PROC SAVE_ALL_REGS has the drawback that the compiler really saves all page registers, even the ones not used.

Daniel

Message Edited by CompilerGuru on 05-18-200602:38 PM

View solution in original post

0 Kudos
2 Replies
464 Views
Technoman64
Contributor III
I found this in Codewarrior Help. I think it is what you are looking for.
 
#pragma TRAP_PROC

Which page registers are saved is determined by the TRAP_PROC pragma. The syntax of this pragma is

#pragma TRAP_PROC [SAVE_ALL_REGS | SAVE_NO_REGS]

If TRAP_PROC SAVE_ALL_REGS is used, all page registers are saved, whether or not they are used in the interrupt procedure. If TRAP_PROC SAVE_NO_REGS is given, no page registers are saved. If only TRAP_PROC is given, all page registers specified with the -Cp option are saved. It is up to you to ensure that no other page registers are modified.

NOTE

The page registers are changed by paged data accesses. For details, see the Paged Variables section.

465 Views
CompilerGuru
NXP Employee
NXP Employee
Or alternatively, use the -CpGPAGE option.
-CpGPAGE=0x10

When this option is used, the compiler will generate the register save code for GPAGE in all interrupt functions, but only if the GPAGE could possibly be modified.

The #pragma TRAP_PROC SAVE_ALL_REGS has the drawback that the compiler really saves all page registers, even the ones not used.

Daniel

Message Edited by CompilerGuru on 05-18-200602:38 PM

0 Kudos