Wednesday, 17 June 2015

Printing Capital Letter And Display it In Assembly Language. (Solution)

// Printing Capital Letter And Display it In Assembly Language. Solution.
/*
    *
    * Prosen Ghosh
    * American International University - Bangladesh (AIUB)
    *
*/

Solution:

.MODEL SMALL
.STACK 100H
.DATA
    STR DB 'IT IS NOT A CAPITAL LETTER'
.CODE

MAIN PROC
 
    MOV AX,@DATA
    MOV DS,AX
 
    MOV AH,1  ;
    INT 21H   ;INPUT THE CHARACTER
    MOV BL,AL ;
 
    CMP AL,'A' ; COMPARE AL GEATHER THAN 'A' IF NOT GOTO END_
    JNGE END_  ;
    CMP AL,'Z' ; COMPARE AL LESS THAN 'Z' IF NOT GOTO END_
    JNLE END_  ;
               ;
    MOV AH,2   ;
    MOV DL,BL  ; PRINTING THE CAPITAL LETTER
    INT 21H    ;
 
    END_:
       
    MAIN ENDP
END MAIN

No comments:

Post a Comment