summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfaissaloo <faissaloo@gmail.com>2016-07-24 11:51:04 +0100
committerfaissaloo <faissaloo@gmail.com>2016-07-24 11:51:04 +0100
commit0b8b4c47a55e647932edc89d994483a56eb22291 (patch)
tree7f33e43114072fe0c53b50551a8ba29375e9cb6a
parent5de12284461b784dac2e5c074909265183d4ef75 (diff)
downloaddbsh-0b8b4c47a55e647932edc89d994483a56eb22291.tar.gz
We can zero the buffer faster now
-rwxr-xr-xshbin1704 -> 1688 bytes
-rw-r--r--sh.asm15
2 files changed, 7 insertions, 8 deletions
diff --git a/sh b/sh
index 72cb49c..b603f81 100755
--- a/sh
+++ b/sh
Binary files differ
diff --git a/sh.asm b/sh.asm
index 81f616f..de56eaf 100644
--- a/sh.asm
+++ b/sh.asm
@@ -71,7 +71,6 @@ _read_loop:
mov rdx, prompt_str_len
syscall
- mov r8, -0x1
call _bzero
_read_loopr:
@@ -138,7 +137,6 @@ _parse_path:
test rax, rax ;check if rax is 0
jl _quit
- mov r8, -0x1
call _bzero
_parse_path2:
@@ -191,13 +189,15 @@ _pathender1:
jmp _pathender
;Writes 0s in buffer r15 until r8 is 255
-;input: r8 (iterator), r15 (buffer), r12 (return address)
+;input: r15 (buffer)
;output: none
_bzero:
- inc r8
- mov byte [r8+r15], 0x0
- cmp r8, 0xff
- jle _bzero
+ xor r8, r8
+ _bzero_main:
+ movups [r15+r8], xmm0
+ add r8, 16
+ cmp r8, 0xff
+ jl _bzero_main
ret
;input: r15 (buffer)
@@ -360,7 +360,6 @@ _treg:
cmp r8, 0xff
jg _boe
xchg r15, rbx
- mov r8, -0x1
call _bzero
_jrsinc: