tags:

views:

125

answers:

3

Where can I find the names of the new registers for assembly on this architecture. I am referring to registers in X86 like EAX, ESP, EBX, etc. But id like them in 64bit.

I tried searching online but cant find anything or I am just not searching for the right thing. I dont think they are the same as wek I disassembly my C code, I get r's instead of e's.

+9  A: 

The old 32-bit registers have been extended to 64 bits, the r registers (rax, rbx, rsp and so on).

In addition, there's some extra general purpose registers r8 through r15 which can also be accessed as (for example) r8d, r8w and r8b (the lower 32-bit double-word, 16-bit word and 8-bit byte respectively).

The high byte of the old 16-bit registers is still accessible as ah, bh, and so on, but this appears to not be the case for the r8 through r15 registers.

In addition, there's some new SSE registers, xmm8 though xmm15.

The eip and flags registers have also been extended to rip and rflags.

See the wikipedia page and MSDN for more details.

Whether these are supported in the asm keyword for a particular C compiler, I couldn't say. What little assembly I do (and it's becoming about one day a year) is done in assembly rather than C.

paxdiablo
+2  A: 

X64 extends the 32-bit general purpose registers as follows:

EAX -> RAX EBX -> RBX ECX -> RCX EDX -> RDX ESI -> RSI EDI -> RDI ESP -> RSP EBP -> RBP

X64 also adds the following 64-bit general purpose registers: R8, R9, R10, R11, R12, R13, R14, R15

Additionally, SSE is part of the X64 specification, so the xmm0-xmm15 vector registers are available as well

You can find some basic info on the architecture at http://en.wikipedia.org/wiki/X86-64 or go to Intel's website.

brainiac
+6  A: 

try this link

x64 extends x64's 8 general-purpose registers to be 64-bit, and adds 8 new 64-bit registers. The 64-bit registers have names beginning with "r", so for example the 64-bit extension of eax is called rax. The new registers are named r8 through r15.

The lower 32 bits, 16 bits, and 8 bits of each register are directly addressable in operands. This includes registers, like esi, whose lower 8 bits were not previously addressable. The following table specifies the assembly-language names for the lower portions of 64-bit registers.

alt text

RRUZ