aboutsummaryrefslogtreecommitdiff
path: root/ft_read.s
blob: 564f2fca9d5ae21a9b0caebc9d475c7fa0743be6 (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
25
26
27
28
29
30
31
; **************************************************************************** ;
;                                                                              ;
;                                                         :::      ::::::::    ;
;    ft_read.s                                          :+:      :+:    :+:    ;
;                                                     +:+ +:+         +:+      ;
;    By: cacharle <marvin@42.fr>                    +;+  +:+       +;+         ;
;                                                 +;+;+;+;+;+   +;+            ;
;    Created: 2019/11/22 03:04:44 by cacharle          ;+;    ;+;              ;
;    Updated: 2019/11/22 21:19:13 by cacharle         ;;;   ;;;;;;;;.fr        ;
;                                                                              ;
; **************************************************************************** ;

global _ft_read

; int ft_read(int, void*, size_t);
_ft_read:
	cmp rdx, 0
	je  FT_READ_NO_SIZE
	cmp rdi, 0
	jl  FT_READ_ERROR
	cmp rsi, 0
	je  FT_READ_ERROR
	mov rax, 0x2000003
	syscall
	ret
FT_READ_ERROR:
	mov rax, -1
	ret
FT_READ_NO_SIZE:
	xor rax, rax
	ret