Advertisement
rafid_shad

A-Z

Oct 23rd, 2019
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. .model small
  2. .data
  3.  
  4. msg1 db  0dh,0ah,"Enter a Value :  $"
  5. msg2 db  0dh,0ah,"The value is Upper Case $"  
  6. msg3 db  0dh,0ah,"The value isn't  upperCase $"
  7.  
  8. x db ?
  9.  
  10. main proc
  11.     mov ax,@data
  12.     mov ds,ax
  13.    
  14.     mov ah,9
  15.     lea dx,msg1
  16.     int 21h  ;print string
  17.    
  18.     mov ah,1
  19.     int 21h   ;take input
  20.     mov x,al  ;move input to variable
  21.    
  22.     CMP x,65   ;compare with 65
  23.     JL level   ; if value less than 65 execute level
  24.    
  25.     CMP x,90   ;compare with 90
  26.     JG level   ; if value greater than 90 execute leve
  27.    
  28.    
  29.     mov ah,9   ;if not the execute this partr
  30.     lea dx,msg2
  31.     int 21h
  32.    
  33.     JMP exit    ;goto exit
  34.    
  35.    
  36.     level:       ;value are same
  37.     mov ah,9  
  38.     lea dx,msg3
  39.     int 21h
  40.    
  41.  
  42.     exit:
  43.     main endp
  44. end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement