Heading ##What is the equivalent of eip, rip registers used for Intel CPU but for ARM/Aaarch64 CPU ?
I need to translate a application written for Intel CPU that uses the 32 bit eip or the 64 bit rip register.
Thoses methods use intel registers:
function GetInstructionPointerRegisterValue --> uses: regs32[eip] or regs64[rip].
function GetStackBasePointerRegisterValue --> uses: regs32[ebp] or regs64[rbp]
function GetStackPointerRegisterValue --> uses: regs32[UESP] or regs64[rsp].
What similar register should I use for ARM ARM/Aaarch64 ?
And does it exist a table with comparison and equivalence of the x86/amd64 registers vs the registers of arm/aarch64 ?
Thanks.
The program counter on ARM/AArch64 is called PC.
ARM has a PC-relative addressing mode with limited range. I assume AArch64 does, too, but it also has
adrpand so on for generating PC-relative addresses into another register, like x86-64 RIP-relative LEA.ARM and AArch64 don't have many/any instructions that implicitly use any specific general-purpose register other than the stack pointer, so the "equivalence table" with x86-64 would be very short. Unlike x86
shl r/m, clfor example, you don't need a value in a specific register to shift by it, more like x86 BMI2shlx reg, reg/mem, regbut without the CISC ability to use a memory source. ARM and AArch64 picked a more orthogonal design to start with instead of having lots of implicit uses for different registers like x86 did to allow shorter instructions with x86's variable-length instruction encoding.