-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putstr.s
33 lines (27 loc) · 1.16 KB
/
ft_putstr.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# **************************************************************************** #
# #
# ::: :::::::: #
# ft_putstr.s :+: :+: :+: #
# +:+ +:+ +:+ #
# By: alaulom <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/01/28 17:02:31 by alaulom #+# #+# #
# Updated: 2016/01/28 17:09:12 by alaulom ### ########.fr #
# #
# **************************************************************************** #
;void ft_putstr(char *s);
%define MACH_SYSCALL(nb) 0x2000000 | nb
%define STDOUT 1
%define WRITE 4
global _ft_putstr
extern _ft_strlen
section .text
_ft_putstr:
push rdi
call _ft_strlen
mov rdx, rax
mov rdi, STDOUT
pop rsi
mov rax, MACH_SYSCALL(WRITE)
syscall
ret