Skip to content

Commit

Permalink
my notes to myself
Browse files Browse the repository at this point in the history
  • Loading branch information
vmchale committed Jun 21, 2024
1 parent 4f4f6e9 commit e04b03a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ABI/stack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
On x64, the stack has to be "16-byte aligned." `malloc` (for instance) uses
this. However, the `call` instruction pushes an address (8 bytes) onto the stack, so it is 8 (mod 16) at the beginning of a procedure.

- https://stackoverflow.com/a/19128544
- community.intel.com/t5/Intel-ISA-Extensions/About-the-x64-stack-Alignment/m-p/881087#M2501

# Apple

In Apple procedures, the stack pointer should be `= 0 (mod 16)` at all times.

0 comments on commit e04b03a

Please sign in to comment.