An Excerpt from hello.s
# The start of our function
generate_message:
.LFB0:
# .LC1, which contains "World", was pushed to %edi,
# which our ABI uses as the first function parameter register
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movq %rdi, -24(%rbp)
movq $0, -8(%rbp)
movq -24(%rbp), %rdx
leaq -8(%rbp), %rax
# Push .LC0, which contains "Hello, %s", into %esi, which is the
# second parameter register
movl $.LC0, %esi
movq %rax, %rdi
movl $0, %eax
call asprintf
movq -8(%rbp), %rax
leave
Rebecca Skinner (
[email protected]) Understanding The Haskell FFI January 11, 2019 18 / 42