Why isn’t the instruction pointer a normal register usable with MOV or ADD?

You can’t access it directly because there’s no legitimate use case. Having any arbitrary instruction change eip would make branch prediction very difficult, and would probably open up a whole host of security issues. You can edit eip using jmp, call or ret. You just can’t directly read from or write to eip using normal … Read more

What do the E and R prefixes stand for in the names of Intel 32-bit and 64-bit registers?

R just stands for “register”. The AMD64 ISA extension added 8 additional general-purpose registers, named R8 through R15. The 64-bit extended versions of the original 8 registers had an R prefix added to them for symmetry. E stands for “extended” or “enhanced”. (Wikipedia says “extended”.) They are the “extended” versions of the 16-bit registers, in … Read more

Reading a register value into a C variable [duplicate]

Editor’s note: this way of using a local register-asm variable is now documented by GCC as “not supported”. It still usually happens to work on GCC, but breaks with clang. (This wording in the documentation was added after this answer was posted, I think.) The global fixed-register variable version has a large performance cost for … Read more

Why are rbp and rsp called general purpose registers?

General purpose means all of these registers might be used with any instructions doing computation with general purpose registers while, for example, you cannot do whatever you want with the instruction pointer (RIP) or the flags register (RFLAGS). Some of these registers were envisioned to be used for specific use, and commonly are. The most … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)