I'm trying to get the current PC value into an assembly routine written for xtensa (lx6) cores. After digging into the instruction set doc, I cannot see really how to achieve this. It looks as if the PC is not mapped into the 16 AR, and I cannot see it listed into the registers I can access through the RSR instruction, or even the RER instruction.
Any advice ?
The following macro is a portable (between xtensa core configurations) way to load full 32-bit runtime address of the label
labelinto the registerar:The
no-transformblock around the call and the following label ensures that no literal pool or jump trampoline is inserted between them.When the macro is used with
arother thana0it preserves the currenta0value in the temporary registerat. Whenarisa0the argumentatis not used and may be omitted.