0
.STACK 100H
.DATA   
.CODE
MAIN PROC          
MOV AX,@DATA 
MOV DS,AX    
;DISPLAY MSG1  
LEA DX,MSG1  
MOV AH, 09H  ;DISPLAY STRING
INT 21H  ;DISPLAY MSG1   
; start of loop        
mov bX,0        
loop_top:
MOV AH,1   
INT 21h
cmp al,0dh  
je Display1             
; testletters    
cmp al,'A'
JL loop_end  
CMP al,'z'
JG loop_end  
INC bx 
loop_end:              
jmp loop_top   
Display1:
LEA DX,MSG2   ;GET MSG1
MOV AH, 09H   ;DISPLAY STRING
INT 21H   ;DISPLAY MSG1
CMP bx,9      
JLE Display3     
mov ah,2
mov dl,'1'
int 21h
mov dl,bl   
add dl,'0'  
SUB dl,10
MOV AH,2   
INT 21H
jmp exit_program 
Display3:
mov dl,bl   
add dl,'0'  
MOV AH,2   
INT 21H     
jmp exit_program      
exit_program:
MOV AH,4CH  
INT 21H                   
MSG1 DB 'PLEASE ENTER YOUR SENTENCE:  $'
MSG2 DB 0DH,0AH,'THE NUMBER OF  LETTERS IN SENTENCE :$'                   
MAIN ENDP
 END MAIN
ENDF
2
Contributors
1
Reply
17
Views
9 Months
Discussion Span
Last Post by Dean_5
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.