From 441b0c35789af6c0f104b06f95d464b19031b47b Mon Sep 17 00:00:00 2001 From: faissaloo Date: Mon, 25 Jul 2016 18:38:32 +0100 Subject: strlen can now be used in other areas --- sh | Bin 1728 -> 1728 bytes sh.asm | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sh b/sh index 1efff95..de08c70 100755 Binary files a/sh and b/sh differ diff --git a/sh.asm b/sh.asm index 9aafb7d..90333eb 100644 --- a/sh.asm +++ b/sh.asm @@ -210,7 +210,7 @@ _parse: ;also needs pipes (|, >, <) xor r13, r13 ;for _strlen push r13 ;push 0 - jmp _strlen + call _strlen ;r8 holds strlen so we start at the end and parse backwards ; go through and sub/push @@ -316,7 +316,7 @@ _parse7: ; absolute path jmp _exec -;input: r12 (return address), r15 (buffer) +;input: r15 (buffer) ;output: r8 (length) _strlen: mov r8, -16 @@ -330,7 +330,7 @@ _strlen: jnz _strlen1 add r8, rcx xchg rsi,rcx - jmp _parse1 + ret ; input: rcx (a), r13 (b) ; output: rbx (string) -- cgit v1.2.3