So apparently on 64 bit assembly, you can do something like
Code:
lea rax, [rip]
and it is legal, but how come on 16 and 32 bit you can't directly do anything that has to do with the IP?
In my entire assembly experience i've been working in 16 bit, so is there something different about 64 bit? Based off the differences that I already am aware of (different memory addressing etc etc) I still can't catch what's different
what is different with
Code:
lea eax, [eip]
?
I'm assuming that they added accessing the IP in 64 bit as a new feature but didn't before?
Yes, being able to reference RIP is a new feature drawn up for the 64 bit architecture.
A new addressing form, RIP-relative (relative instruction-pointer) addressing, is implemented in 64-bit mode. An effective address is formed by adding displacement to the 64-bit RIP of the next instruction.
No one can really answer that question, but you can always read/write the IP register anyway through indirect methods on 16/32 bit anyway so it's not really needed.