Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .8086
- cseg segment
- assume cs:cseg
- org 100h
- start:
- mov ax, 12345
- mov cx, 10
- mov di, offset digit
- call WToAscii
- mov [di], byte ptr 0Dh
- inc di
- mov [di], byte ptr 0Ah
- inc di
- mov [di], byte ptr '$'
- mov dx, offset digit
- mov ah, 9h
- int 21h
- mov ah, 4ch
- int 21h
- WToAscii proc near
- xor dx, dx
- div cx
- or ax, ax
- jz done
- push dx
- call WToAscii
- pop dx
- done:
- mov al, dl
- or al, '0'
- mov [di], al
- inc di
- ret
- WToAscii endp
- digit BYTE 10 dup(?)
- cseg ends
- end start
Advertisement
Add Comment
Please, Sign In to add comment