-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_isalnum.s
39 lines (34 loc) · 1.32 KB
/
ft_isalnum.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
34
35
36
37
38
39
# **************************************************************************** #
# #
# ::: :::::::: #
# ft_isalnum.s :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vtarasiu <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/07/19 13:41:48 by vtarasiu #+# #+# #
# Updated: 2019/07/19 14:20:21 by vtarasiu ### ########.fr #
# #
# **************************************************************************** #
section .text
global ft_isalnum
global _ft_isalnum
extern _ft_isalpha
extern _ft_isdigit
ft_isalnum:
_ft_isalnum:
push rbp
mov rbp, rsp
call _ft_isalpha
cmp rax, 0
jg .isalnum_succ ; if alpha, return success
call _ft_isdigit
cmp rax, 0
jle .isalnum_fail ; if not alpha and not digit, goto fail
.isalnum_succ:
mov rax, 1
jmp .isalnum_over
.isalnum_fail:
mov rax, 0
.isalnum_over:
pop rbp
ret