Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include "emu8086.inc"
- .model small
- .stack 100h
- .code
- main proc
- print "Enter a character: "
- mov ah,1
- int 21h
- mov bl,0h
- printn
- print "Here the ASCII to Binary is: "
- mov cl,0
- top:
- cmp cl,8
- je exit
- Rol al,1
- jnc zero
- jc one
- jmp exit
- zero:
- print "0"
- inc cl
- jmp top
- one:
- print "1"
- inc cl
- inc bl
- jmp top
- exit:
- printn
- print "Here the 1-bits has: "
- add bl,30h
- mov ah,2
- mov dl,bl
- int 21h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement