3 ms·
Isn't having control of the program counter just a branch instruction? :)
by lebuffon 6y ago
Isn't having control of the program counter just a branch instruction?
:)
- saagarjha 6y agoDoes your ISA let you double the program counter? How about XOR it?
- Reelin 6y agoThis got me curious so I looked it up. My understanding is yes on ARM32, not sure on ARM64, and yes with only minor indirection on x86 and x86_64. For example (x86, untested): call 0 pop eax shl eax 1 jmp eax Note that using call 0 in this way doesn't trash the return address predictor because it is special cased (since at least Pentium Pro as far as I could find).