Use ds instead of es for itoa

This commit is contained in:
Juhani Krekelä 2021-07-04 23:40:39 +03:00
parent ca070d672e
commit 6bcfcbd7cc
1 changed files with 4 additions and 4 deletions

View File

@ -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