السلام عليكم ورحمة الله وبركاته ...
المطلوب هو :
اقتباسWrite a program that takes an input sentence from the user and on next line display the number of capitals letters in the sentence.Note:
· User is not allowed to enter a sentence with more than 9 Capital letters.
حلي :
.MODEL SMALL .STACK 100H .DATA MSG1 DB 'PLEASE ENTER YOUR SENTENCE: $' MSG2 DB 0DH,0AH,'THE NUMBER OF CAPITAL LETTERS IN SENTENCE :$' MSG3 DB 0DH,0AH,'You have entered more than 9 capital liter $' .CODE MAIN PROC MOV AX,@DATA;initialize DS MOV DS,AX ;DISPLAY MSG1 LEA DX,MSG1 ;GET MSG1 MOV AH,9 ;DISPLAY STRING INT 21H ;DISPLAY MSG1 ;READ CHARCHTER ;if the user has entered more than 9 capital liter exit ... MOV bx,0 mov cx,9 MOV AH,1 ;READ sentenc TOP: INT 21h Mov bl,al cmp bl,'A' JGE Count CMP bl,'Z' JLE Count Count: INC bx LOOP TOP LEA DX,MSG2 ;GET MSG2 MOV AH,9 ;DISPLAY STRING INT 21H ;DISPLAY MSG1 mov ah,2 mov DX,BX INT 21H MOV AH,4CH; return control to DOS INT 21H MAIN ENDP END MAIN END
مشكلتي :
اني لم اعرف كيف اعمل count لـ Capital letters.
" User is not allowed to enter a sentence with more than 9 Capital letters. "