From 318ef10263d28f511e4b35b6502cfc9e4c8e2092 Mon Sep 17 00:00:00 2001 From: johannst Date: Thu, 17 Sep 2020 00:11:17 +0200 Subject: add links to intel x86_64 docs + minor fixes --- src/arch/x86_64.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/arch/x86_64.md b/src/arch/x86_64.md index 85ef57a..d55ccd6 100644 --- a/src/arch/x86_64.md +++ b/src/arch/x86_64.md @@ -1,6 +1,11 @@ # x86_64 +keywords: x86_64, x86, abi + +- 64bit synonyms: `x86_64`, `x64`, `amd64`, `intel 64` +- 32bit synonyms: `x86`, `ia32`, `i386` +- ISA type: `CISC` +- Endianness: `little` -Synonyms: `x86_64`, `x64`, `amd64` ## Registers ### General purpose register @@ -16,7 +21,7 @@ rsi esi si - sil source index rdi edi di - dil destination index rbp ebp bp - bpl base pointer rsp esp sp - spl stack pointer -r8...r15 rNd rNw - rNb +r8-15 rNd rNw - rNb ``` ### Special register @@ -68,7 +73,7 @@ mov dword ptr [rax], 0xff // save 4 byte(s) at [rax] mov qword ptr [rax], 0xff // save 8 byte(s) at [rax] ``` -## [SysV AMD64 ABI][sysvabi] +## [SysV x86_64 ABI][sysvabi] ### Passing arguments to functions - Integer/Pointer arguments @@ -90,7 +95,8 @@ mov qword ptr [rax], 0xff // save 8 byte(s) at [rax] .. .. xmm7 7 ``` -- Additional arguments are passed on the stack (RTL right-to-left) +- Additional arguments are passed on the stack. Arguments are pushed + right-to-left (RTL), meaning next arguments are closer to current `rsp`. ### Return values from functions - Integer/Pointer return values @@ -143,11 +149,14 @@ must must save these registers in case they are used. ``` ## References -- [SystemV AMD64 abi][sysvabi] +- [SystemV AMD64 ABI][sysvabi] - [AMD64 Vol1: Application Programming][amd64_vol1] - [AMD64 Vol2: System Programming][amd64_vol2] - [AMD64 Vol3: General-Purpose & System Instructions][amd64_vol3] -- [X86_64 Cheat-Sheet][x86_64_cheat] +- [X86_64 Cheat-Sheet][x86_64_cheatsheet] +- [Intel 64 Vol1: Basic Architecture][intel64_vol1] +- [Intel 64 Vol2: Instruction Set Reference][intel64_vol2] +- [Intel 64 Vol3: System Programming Guide][intel64_vol3] [sysvabi]: https://www.uclibc.org/docs/psABI-x86_64.pdf @@ -155,5 +164,7 @@ must must save these registers in case they are used. [amd64_vol2]: https://www.amd.com/system/files/TechDocs/24593.pdf [amd64_vol3]: https://www.amd.com/system/files/TechDocs/24594.pdf [x86_64_cheatsheet]: https://cs.brown.edu/courses/cs033/docs/guides/x64_cheatsheet.pdf +[intel64_vol1]: https://software.intel.com/content/www/us/en/develop/download/intel-64-and-ia-32-architectures-software-developers-manual-volume-1-basic-architecture.html +[intel64_vol2]: https://software.intel.com/content/www/us/en/develop/download/intel-64-and-ia-32-architectures-sdm-combined-volumes-2a-2b-2c-and-2d-instruction-set-reference-a-z.html +[intel64_vol3]: https://software.intel.com/content/www/us/en/develop/download/intel-64-and-ia-32-architectures-sdm-combined-volumes-3a-3b-3c-and-3d-system-programming-guide.html [gas_directives]: https://sourceware.org/binutils/docs/as/Pseudo-Ops.html#Pseudo-Ops - -- cgit v1.2.3