From 0e73aff73d301aac59dd604f6137969c3e2403ce Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 6 Feb 2020 00:29:09 +0100 Subject: read write protection, ft_list_size, ft_list_push_front finished --- ft_read.s | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ft_read.s') diff --git a/ft_read.s b/ft_read.s index 00718e8..564f2fc 100644 --- a/ft_read.s +++ b/ft_read.s @@ -14,6 +14,18 @@ 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 -- cgit