Use ds instead of es for itoa
This commit is contained in:
parent
ca070d672e
commit
6bcfcbd7cc
|
@ -1,8 +1,8 @@
|
||||||
; IN:
|
; IN:
|
||||||
; ax = number to convert
|
; ax = number to convert
|
||||||
; es:bx = storage buffer
|
; ds:bx = storage buffer
|
||||||
; OUT:
|
; OUT:
|
||||||
; es:bx = start of converted number
|
; ds:bx = start of converted number
|
||||||
itoa:
|
itoa:
|
||||||
push ax
|
push ax
|
||||||
push cx
|
push cx
|
||||||
|
@ -11,7 +11,7 @@ itoa:
|
||||||
mov cx, 10
|
mov cx, 10
|
||||||
|
|
||||||
add bx, 5
|
add bx, 5
|
||||||
mov byte [es:bx], 0
|
mov byte [bx], 0
|
||||||
|
|
||||||
.convert_loop:
|
.convert_loop:
|
||||||
test ax, ax
|
test ax, ax
|
||||||
|
@ -22,7 +22,7 @@ itoa:
|
||||||
|
|
||||||
add dl, '0'
|
add dl, '0'
|
||||||
dec bx
|
dec bx
|
||||||
mov byte [es:bx], dl
|
mov byte [bx], dl
|
||||||
|
|
||||||
jmp .convert_loop
|
jmp .convert_loop
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue