From 437b37306ec441823d401fe64fbf99936754b206 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 29 Sep 2020 19:25:07 +0000 Subject: deploy: 871f1a6f408a9b50182c8688d4aeec26bd6b2d93 --- arch/x86_64.html | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'arch/x86_64.html') diff --git a/arch/x86_64.html b/arch/x86_64.html index 26679a1..19a9f09 100644 --- a/arch/x86_64.html +++ b/arch/x86_64.html @@ -81,7 +81,7 @@ @@ -203,7 +203,7 @@ movw rax, [rbx+4*rcx] // load val at [rbx+4*rcx] into rax

Size directives

Explicitly specify size of the operation.

-
mov  byte ptr [rax], 0xff    // save 1 byte(s) at [rax]
+
mov  byte ptr [rax], 0xff    // save 1 byte(s) at [rax]
 mov  word ptr [rax], 0xff    // save 2 byte(s) at [rax]
 mov dword ptr [rax], 0xff    // save 4 byte(s) at [rax]
 mov qword ptr [rax], 0xff    // save 8 byte(s) at [rax]
@@ -227,7 +227,7 @@ r9        6
 -----------
 xmm0      1
   ..     ..
-xmm7      7
+xmm7      8
 
  • Additional arguments are passed on the stack. Arguments are pushed @@ -274,7 +274,7 @@ must must save these registers in case they are used.

    • grows downwards
    • frames aligned on 16 byte boundary -
      HI ADDR
      +
      Hi ADDR
        |                +------------+
        |                | prev frame |
        |                +------------+ <--- 16 byte aligned (X & ~0xf)
      @@ -283,10 +283,26 @@ must must save these registers in case they are used.

      | [rbp-8] | func stack | | | ... | v +------------+ -LO ADDR +Lo ADDR
    +

    Function prologue & epilogue

    +
      +
    • prologue +
      push rbp        // save caller base pointer
      +mov rbp, rsp    // save caller stack pointer
      +
      +
    • +
    • epilogue +
      mov rsp, rbp    // restore caller stack pointer
      +pop rbp         // restore caller base pointer
      +
      +
      +

      Equivalent to leave instruction.

      +
      +
    • +

    ASM skeleton

    Small assembler skeleton, ready to use with following properties:

    @@ -348,6 +366,10 @@ Hi ASM-World! + +
    @@ -362,6 +384,10 @@ Hi ASM-World! + + -- cgit v1.2.3