Skip to content

Instantly share code, notes, and snippets.

@tomstuart
Created April 12, 2015 17:58
Show Gist options
  • Save tomstuart/fb81c71a3c472c62d03c to your computer and use it in GitHub Desktop.
Save tomstuart/fb81c71a3c472c62d03c to your computer and use it in GitHub Desktop.

Revisions

  1. tomstuart created this gist Apr 12, 2015.
    53 changes: 53 additions & 0 deletions calling-convention.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,53 @@
    before function call: at start of function call:

    ARG: args for caller args for caller
    saved state for caller saved state for caller
    LCL: locals for caller locals for caller
    stack for caller stack for caller
    args for callee --> ARG: args for callee
    SP: saved state for callee
    LCL: locals for callee
    SP:

    |
    V

    after function call: at finish of function call:

    ARG: args for caller args for caller
    saved state for caller saved state for caller
    LCL: locals for caller locals for caller
    stack for caller stack for caller
    return value for callee <-- ARG: args for callee
    SP: saved state for callee
    LCL: locals for callee
    stack for callee
    return value for callee
    SP:















    before function call: | at start of function call: | at finish of function call: | after function call:
    | | |
    ARG: args for caller | args for caller | args for caller | ARG: args for caller
    saved state for caller | saved state for caller | saved state for caller | saved state for caller
    LCL: locals for caller | locals for caller | locals for caller | LCL: locals for caller
    stack for caller | stack for caller | stack for caller | stack for caller
    args for callee | ARG: args for callee | ARG: args for callee | return value for callee
    SP: | saved state for callee | saved state for callee | SP:
    | LCL: locals for callee | LCL: locals for callee |
    | SP: | stack for callee |
    | | return value for callee |
    | | SP: |