aboutsummaryrefslogtreecommitdiff
path: root/tests/foo_64_unix.asm
blob: e91767a469e0043fd0a474cba283933b05bb443d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
bits 64

extern puts
global foo

section .data

message:
  db 'foo() called', 0

section .text

foo:
  nop
  push rbp
  mov rbp, rsp
  lea rdi, [rel message]
  %ifdef USE_PLT
    call puts wrt ..plt
  %else
    call puts
  %endif
  pop rbp
  ret