Week 8: x86 and AArch64 Architecture

Minh Q. To
2 min readNov 14, 2021

--

ARM architecture: acorn micro computers -> AArch64. This is an extension which is a 64 bit mode of ARM architecture.

ARM (acorn RISC machine). This is now a family of processors. Useful in PDAs. Developed a way to keep power consumption low (using for small devices). They updated the ARM architecture to be AArch64 in order to support faster networking!f

x86: any Intel processor that belongs to the 86 family. Ex. 8086, 8186

x86_64: An 86 family processor that has 64 bit capability

Differences in x86 and aarch64 architectures

x86_64

  • 16 general-purpose registers
  • Main registers are RAX, RBX, RCX, RDX
  • The naming convention for the registers is based on bit transfers. The register you use isn’t changed, but the name used to refer to that register DOES, depending on the size of the data being transferred. For example, if you’re using register 8 and transferring 64 bits, we call the register RAX. For 32 bits, we call it EAX. For 16 bits, AX. For 8 bits, AH. And 8 bits, AL.
  • For function calls, parameters are stored in certain registers, up to a certain amount of parameters. From parameters 1 to 6, they get stored in RDI, RSI, RDX, RCX, R8 and R9, respectively
  • In addition, this architecture preserves 7 registers for us, and guarantee that the function does not alter the data inside these registers

AArch64

  • 31 general-purpose register + 1 special registers
  • Uses numbers to label registers. Ex. R0, R1
  • When transferring different bit sizes, we refer to the registers with different names. For example, for register 0 and we’re transferring 64 bits, we call it X0. For 32 bits, we call it W0.
  • For function calls, we can store up to 8 parameters, which is 2 more than x86_64. This architecture uses R0 to R7 to store the 8 parameters

Cools things I learned

  • Since modern processors are so fast, they will often guess the outcome of an operation. Modern processors have multiple copies of registers that store the results of “guesses”.
  • Modern operating systems hide the details of what the OS is doing from programs

--

--