From 0b8b4c47a55e647932edc89d994483a56eb22291 Mon Sep 17 00:00:00 2001 From: faissaloo Date: Sun, 24 Jul 2016 11:51:04 +0100 Subject: We can zero the buffer faster now --- sh | Bin 1704 -> 1688 bytes sh.asm | 15 +++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sh b/sh index 72cb49c..b603f81 100755 Binary files a/sh and b/sh 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: -- cgit v1.2.3