Fixed read loop glitch
This commit is contained in:
6
helper.s
6
helper.s
@@ -64,6 +64,7 @@ read:
|
||||
# rsi = char*
|
||||
write:
|
||||
push r15
|
||||
push r11
|
||||
mov r15, rdi
|
||||
mov rdi, rsi # no need to touch rsi
|
||||
call count
|
||||
@@ -73,6 +74,7 @@ write:
|
||||
mov rdi, r15
|
||||
|
||||
syscall
|
||||
pop r11
|
||||
pop r15
|
||||
ret
|
||||
|
||||
@@ -80,9 +82,9 @@ write:
|
||||
count:
|
||||
mov rax, rdi
|
||||
count_loop:
|
||||
mov r8b, [rax]
|
||||
mov r9b, [rax]
|
||||
inc rax
|
||||
cmp r8b, 0
|
||||
cmp r9b, 0
|
||||
jnz count_loop
|
||||
dec rax
|
||||
sub rax, rdi
|
||||
|
Reference in New Issue
Block a user