Convert Decimal to Binary
- .model small
- .stack 150h
- .data
- s1 db 0dh,0ah,"convert:$"
- .code
- main proc
- mov ax,@data
- mov ds,ax
- mov ah,1
- int 21h
- mov bl,al
- mov cl,0
- and bl,0Fh
- mov ah,9
- lea dx,s1
- int 21h
- l1:
- shl bl,1
- jnc l4
- mov dl,'1'
- mov ah,2
- int 21h
- jmp l5
- l4:
- mov dl,'0'
- mov ah,2
- int 21h
- l5:
- inc cl
- cmp cl,8
- jne l1
- end:
- main endp
- end main
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment