Skip to content

Commit

Permalink
chapter1 > missing linefeed
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed May 1, 2018
1 parent 5419f98 commit 7d85e9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapter1_assembly_primer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ The Go calling convention mandates that every argument must be passed on the sta
It is the caller's responsibility to grow (and shrink back) the stack appropriately so that arguments can be passed to the callee, and potential return-values passed back to the caller.

The Go compiler never generates instructions from the PUSH/POP family: the stack is grown or shrunk by respectively decrementing or incrementing the ~virtual~ hardware stack pointer `SP`.
*[UPDATE: We've discussed about this matter in [issue #21: about SP register](https://github.com/teh-cmc/go-internals/issues/21).]*
> The SP pseudo-register is a virtual stack pointer used to refer to frame-local variables and the arguments being prepared for function calls. It points to the top of the local stack frame, so references should use negative offsets in the range [−framesize, 0): x-8(SP), y-4(SP), and so on.
*[UPDATE: We've discussed about this matter in [issue #21: about SP register](https://github.com/teh-cmc/go-internals/issues/21).]*
Although the official documentation states that "*All user-defined symbols are written as offsets to the pseudo-register FP (arguments and locals)*", this is only ever true for hand-written code.
Like most recent compilers, the Go tool suite always references argument and locals using offsets from the stack-pointer directly in the code it generates. This allows for the frame-pointer to be used as an extra general-purpose register on platform with fewer registers (e.g. x86).
Expand Down

0 comments on commit 7d85e9e

Please sign in to comment.