aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/int2str.s8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/int2str.s b/src/lib/int2str.s
index 1e9801b..0acf4b8 100644
--- a/src/lib/int2str.s
+++ b/src/lib/int2str.s
@@ -62,6 +62,7 @@ int2str:
# shift string to leftmost in buffer if not already there
cmpq %rax, %r9
je .done # already leftmost
+ cld # Clear direction flag (forward copy)
movq %rdx, %rcx # rcx = length of string
movq %rax, %rsi # rsi = source :: start of string
movq %r9, %rdi # rdi = destination :: original buff start
@@ -69,9 +70,10 @@ int2str:
# Found this online. It's a way to copy down values in memoery.
# movbs = Move String Byte..
# It copies 1 byte from memoery to memoery and
- # incrementing destination and incrementing source.
- # Source :: %rsi
- # Dest :: %rdi
+ # incrementing each pointer.
+ # Source :: %rsi
+ # Dest :: %rdi
+ # Direction Flag :: DF ~ 0 for inc and 1 dec
# rep = repeat wow.
# It's a prefix that repeats an isntructution rcx times
# https://stackoverflow.com/questions/27804852/assembly-rep-movs-mechanism