Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

TO INPUT A HEX CHARACTER AND DISPLAY IT AS MANY TIMES AS THAT OF THE HEX CHARACTER

Posted By: Thomas Evans     Category: Assembly Language     Views: 3863

TO INPUT A HEX CHARACTER AND DISPLAY IT AS MANY TIMES AS THAT OF THE HEX CHARACTER.

Code for TO INPUT A HEX CHARACTER AND DISPLAY IT AS MANY TIMES AS THAT OF THE HEX CHARACTER in Assembly Language

.MODEL SMALL

.STACK 64

.DATA
        NL DB 0DH,0AH,'$'
.CODE

MAIN PROC
        MOV AX,@DATA
        MOV DS,AX

        MOV AH,01H
        INT 21H
        MOV BL,AL

        MOV AH,09H
        LEA DX,NL
        INT 21H

        MOV DL,BL

        CMP BL,41H
        JE ALPHA

        CMP BL,42H
        JE ALPHA

        CMP BL,43H
        JE ALPHA

        CMP BL,44H
        JE ALPHA

        CMP BL,45H
        JE ALPHA

        CMP BL,46H
        JE ALPHA

        JMP OTHERS

ALPHA:
        SUB BL,37H
        MOV CL,BL

        JMP DISP
 
OTHERS:
        SUB BL,30H
        MOV CL,BL

DISP:
        MOV AH,02H
        INT 21H

        DEC CL
        JNZ DISP

        MOV AH,4CH
        INT 21H

MAIN ENDP
END MAIN

;*********************************************
;              OUTPUT
;*********************************************

;5
;55555
  
Share: 



Thomas Evans
Thomas Evans author of TO INPUT A HEX CHARACTER AND DISPLAY IT AS MANY TIMES AS THAT OF THE HEX CHARACTER is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!