diff --git a/dos/str/strrev.k b/dos/str/strrev.k index 246d212..be2ff88 100644 --- a/dos/str/strrev.k +++ b/dos/str/strrev.k @@ -9,6 +9,9 @@ strrev: cmovz b[ax0], 0 jz .4 + ; save str's location + mov rdx, ax1 + .1: test b[ax1+1], b[ax1+1] jz .2 @@ -19,8 +22,8 @@ strrev: .2: mov b[ax0], b[ax1] - test b[ax1], b[ax1] - jz .3 + cmp ax1, rdx + je .3 inc ax0 dec ax1