Convert an ASCII coded decimal number into its binary equivalent.

7).Convert an ASCII coded decimal number into its binary equivalent.

.MODEL SMALL
.DATA
MESG DB 10,13, 'ENTER NO: $'
RESULT DB 10,13, 'RESULT IS: $'
.CODE
.STARTUP
MOV DX,OFFSET MESG
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
MOV BL,AL
MOV DX,OFFSET RESULT
MOV AH,09H
0INT 21H
MOV CL,08H
MOV AH,00H
MOV AL,BL
L1: SHL AL, 01H
MOV BL,AL
MOV AL,00H
ADC AL,30H
MOV DL,AL
MOV AH,02H
INT 21H
MOV AL,BL
LOOP L1
.EXIT

END

No comments:

Post a Comment

Featured post

Amazon Interview Process

On July 5, 1994, Jeff Bezos started the world's most "customer-centric" firm out of his garage in Bellevue, Washington. The A...