;2- Write an assembly language program (write a complete program) that count the key presses from the user until he press enter (Carriage return 0DH)

Code:
.STACK 100H

 .DATA
    PROMPT  DB  'Enter char to count it (Enter to Exit.) : $'

 .CODE
   MAIN PROC
     MOV AX, @DATA                ; initialize DS
     MOV DS, AX

     LEA DX, PROMPT               ; load and print PROMPT
     MOV AH, 9
     INT 21H

     Mov ah,1
     Int 21h


     MOV CX, 10                   ; initialize CX

     MOV AH, 2                    ; set output function
     MOV DL, 41H                  ; set DL=A

     @DO_WHILE_LOOP:              ; loop label
       INT 21H                    ; print character

       INC DL                     ; increment DL to next ASCII character
       DEC CX                     ; decrement CX
     JNZ @DO_WHILE_LOOP           ; jmp to label @DO_WHILE_LOOP

     MOV AH, 4CH                  ; return control to DOS
     INT 21H
   MAIN ENDP
 END MAIN
this corect solution plz help me

Last edited by shabbir; 10Jun2011 at 15:43.. Reason: Code blocks