feat: ft_isspace
This commit is contained in:
parent
f8c8321615
commit
695838e06c
2 changed files with 25 additions and 1 deletions
4
Makefile
4
Makefile
|
|
@ -17,7 +17,9 @@ SRCS=$(SRC_DIR)/ft_strlen.asm \
|
||||||
$(SRC_DIR)/ft_read.asm \
|
$(SRC_DIR)/ft_read.asm \
|
||||||
$(SRC_DIR)/ft_strdup.asm \
|
$(SRC_DIR)/ft_strdup.asm \
|
||||||
$(SRC_DIR)/ft_memcpy.asm \
|
$(SRC_DIR)/ft_memcpy.asm \
|
||||||
$(SRC_DIR)/ft_bzero.asm
|
$(SRC_DIR)/ft_isspace.asm \
|
||||||
|
$(SRC_DIR)/ft_bzero.asm \
|
||||||
|
$(SRC_DIR)/ft_atoibase.asm
|
||||||
|
|
||||||
OBJS=$(patsubst $(SRC_DIR)/%.asm,$(OBJ_DIR)/%.o,$(SRCS))
|
OBJS=$(patsubst $(SRC_DIR)/%.asm,$(OBJ_DIR)/%.o,$(SRCS))
|
||||||
DEPS=$(OBJS:.o=.d)
|
DEPS=$(OBJS:.o=.d)
|
||||||
|
|
|
||||||
22
src/ft_isspace.asm
Normal file
22
src/ft_isspace.asm
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
global ft_isspace
|
||||||
|
section .rodata
|
||||||
|
ws_chars db ' ',9,10,13,11,12
|
||||||
|
|
||||||
|
section .text
|
||||||
|
; input: dil
|
||||||
|
ft_isspace:
|
||||||
|
lea r10, [rel ws_chars]
|
||||||
|
mov rcx, 6
|
||||||
|
.loop:
|
||||||
|
cmp dil, [r10]
|
||||||
|
je out_is_space
|
||||||
|
inc r10
|
||||||
|
loop .loop
|
||||||
|
|
||||||
|
out_not_space:
|
||||||
|
xor rax, rax
|
||||||
|
ret
|
||||||
|
out_is_space:
|
||||||
|
mov rax, 1
|
||||||
|
ret
|
||||||
|
|
||||||
Loading…
Add table
Reference in a new issue