Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is the x64 architecture different from x86

I need to mess around with the stacks on these architecture and am really a n00b here. Any pointers to reading topics/google searches that i can do. I am looking for how these architectures are fundamentally different from each other. something more than the wikipedia article on this topic http://en.wikipedia.org/wiki/X64

like image 292
Scott J Avatar asked Nov 23 '09 17:11

Scott J


People also ask

What is the difference between x86 and x64 architectures?

A 32-bit processor on x86 architecture has 32-bit registers, while 64-bit processors have 64-bit registers. Thus, x64 allows the CPU to store more data and access it faster. The register width also determines the amount of memory a computer can utilize. Introduced in 1978.

What is the difference between x64 and x86 Windows 10?

Whats the Difference? Windows 10 x86 (32-bit) is limited to using 4GB of RAM or less on PCs. Windows 10 x64 (64-bit) can use more than 4GB of RAM and it does this by using the AMD64 standard for 64-bit instructions. This needs the system to be able to support 64bit.

What is the difference between x64 x86 arm64?

x86_64 is the architecture of Intel's 64-bit CPUs, sometimes also simply referred to as x64 . It is the architecture for all Intel Macs shipped between 2005 and 2021. arm64 is the architecture used by newer Macs built on Apple Silicon, shipped in late 2020 and beyond.

Is x86-64 the same as x64?

x86-64 is also known as x64 and AMD64. x86-64 enables 64-bit processing advantages such as increased memory space (up to 256TB) and processing more data per clock cycle. The technology is similar to Intel's server-oriented IA-64.


2 Answers

In x86 there are 8 32 bit registers, in x64 the registers are 64 bits each and there are 8 more of them. The 128 bit SSE registers are 128 bits in both, but on x86 there are 8 of them while in x64 there are 16 of them. Also some instructions were cut in x64.

In x64 mode you can still use the registers as 32 bits by using their 32 bit name(starting with an 'e') instead of their 64 bit name(starting with an 'r'), and the assembly would be mostly the same.

http://en.wikipedia.org/wiki/X86#x86_registers

Or if you want some really heavy reading(like 1000s of pages...)

http://www.intel.com/products/processor/manuals/index.htm I read through a few hundred pages of those manuals and learned a lot, really good stuff.

like image 154
Ramónster Avatar answered Nov 05 '22 09:11

Ramónster


All the answers here mention the changes in the register set, which I'll list here for completeness:

  • All existing 32-bit general purpose registers are extended to 64 bits (EAX is extended to RAX and so on)
  • 8 new 64-bit general purpose registers (R8 through R15)
  • 8 new 128-bit SSE registers (XMM8 through XMM15)

There are also changes in addressing modes:

  • CS, DS, ES and SS are flat. That is, their base is 0x0 and their limit is 0xffffffffffffffff. FS and GS can have a base over 32 bits.
  • Descriptors in the GDT, LDT and IDT have changed. They have 8 bytes in 64-bit mode
  • A non-contiguous address space. In 32-bit mode the linear address space is from 0x0 to 0xfffffff. In 64-bit mode the linear address space is split from 0x0 to 0x00007ffffffff and from 0xffff800000000000 to 0xffffffffffffffff. Basically, there are only 48 bits of address, and the address is sign-extended to 64 bits.
  • A new paging mode.

Various instructions were removed:

  • One byte INC instructions with encoding 40+rw and 40+rd. The 4x byte became the REX prefix.
  • instructions for loading the segment registers that are now flat: LDS, LDS, LSS.

There are more differences that I simply can remember off the top of my head. I'll add them if I can think of some more.

like image 23
Nathan Fellman Avatar answered Nov 05 '22 11:11

Nathan Fellman