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