summaryrefslogtreecommitdiff
path: root/string.asm
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2018-05-18 20:23:08 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2018-05-18 20:23:08 -0400
commita34224e401c9108d1d872ef893f71e7511c4ef39 (patch)
treee474b157069a054cdeb33807e18ce5067f4fa655 /string.asm
parent7df08205d41e77f93429af424904d4f8a44af658 (diff)
downloadminos-a34224e401c9108d1d872ef893f71e7511c4ef39.tar.gz
More complete initialization
Diffstat (limited to 'string.asm')
-rw-r--r--string.asm6
1 files changed, 5 insertions, 1 deletions
diff --git a/string.asm b/string.asm
index 7da36db..ea197d2 100644
--- a/string.asm
+++ b/string.asm
@@ -181,10 +181,14 @@ strtok:
push si
xor ax, ax ; clear AX for delimter
+ xor bx, bx
xor cx, cx ; initialize string length counter
xor dx, dx ; initialize record counter
+ xor si, si
+ xor di, di
+
sub sp, 2 ; reserve stack variable
- ; final_pass = [bp - 2]
+ mov word [bp - 2], 0 ; final_pass = [bp - 2]
mov di, [bp + 4] ; arg1 - null terminated string
mov si, [bp + 6] ; arg2 - address of results array