Skip to content

Instantly share code, notes, and snippets.

@mwhudson
Created November 30, 2015 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwhudson/505e53d5f24a22764ed2 to your computer and use it in GitHub Desktop.
Save mwhudson/505e53d5f24a22764ed2 to your computer and use it in GitHub Desktop.
runtime.exit looks like this:
TEXT runtime·exit(SB),NOSPLIT,$0
MOVL $252, AX // syscall number
MOVL code+0(FP), BX
INVOKE_SYSCALL
INT $3 // not reached
RET
asmfmt writes this as:
TEXT runtime·exit(SB), NOSPLIT, $0
MOVL $252, AX // syscall number
MOVL code+0(FP), BX
INVOKE_SYSCALL
INT $3 // not reached
RET
but I think:
TEXT runtime·exit(SB), NOSPLIT, $0
MOVL $252, AX // syscall number
MOVL code+0(FP), BX
INVOKE_SYSCALL
INT $3 // not reached
RET
is better.
@cespare
Copy link

cespare commented Nov 30, 2015

Did you intend to have a tab after MOVL on line 22?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment