How to read S12X Program counter and XGPC?

Discussion created by Xbot on May 8, 2008
Latest reply on May 8, 2008 by Xbot
Hi all,
I am implementing a code that would copy all the necessary register values to the NVM when an access violation occur then followed by a COP reset. The registers include the Global clock, gpage, and PC.
My question is how do i read the s12x PC? is executing firmware command the only way? also, is this true for XGPC?