diff options
Diffstat (limited to 'subx')
-rw-r--r-- | subx/examples/ex8.subx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/subx/examples/ex8.subx b/subx/examples/ex8.subx index 688d7f1f..de0fa188 100644 --- a/subx/examples/ex8.subx +++ b/subx/examples/ex8.subx @@ -44,18 +44,18 @@ ascii_length: # (s) 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/ESP 4/index/none 2/r32/EDX 4/disp8 # copy *(ESP+4) to EDX # var result = 0 (EAX) b8/copy . . . . . . . 0/imm32 # copy 0 to EAX -$al_loop: +$ascii_length_loop: # var c = *s (ECX) 8a/copy 0/mod/* 2/rm32/EDX . . . 1/r32/ECX . . # copy byte at *EDX to lower byte of ECX # if c == '\0' break 81 7/subop/compare 3/mod/direct 1/rm32/ECX . . . . . 0/imm32 # compare ECX with 0 - 74/jump-if-equal $al_ret/disp8 + 74/jump-if-equal $ascii_length_ret/disp8 # ++s 81 0/subop/add 3/mod/direct 2/rm32/EDX . . . . . 1/imm32 # add 1 to EDX # ++result 81 0/subop/add 3/mod/direct 0/rm32/EAX . . . . . 1/imm32 # add 1 to EAX # loop - eb/jump $al_loop/disp8 -$al_ret: + eb/jump $ascii_length_loop/disp8 +$ascii_length_ret: # return (result in EAX) c3/return |