title: Time delay counter in 8086
body: <p>I have the following code that delays the printing of a message specified by a user. But, having problems in understanding it. For eg: In line 23, why it is written MOV AX,BX, i can't see BX containeing any value then what is moved in AX register? Also, why do we write  MOV CL,0AH. Please help!</p>
  
  <pre><code>.MODEL SMALL
  .DATA
  
  MSGIN DB 'Enter delay duration (0-50): $'
  MSG1 DB 'This is Microprocessor!$'
   DELAYTIME DW 0000H
  
  .CODE
  
  MOV DX,@DATA
  MOV DS,DX
  LEA DX,MSGIN
  MOV AH,09H
  INT 21H
  
  IN1:    
      MOV AH,01H
      INT 21H
      CMP AL,0DH   ;
      JE NXT
      SUB AL,30H
      MOV DL,AL
      MOV AX,BX
      MOV CL,0AH
      MUL CL
      MOV BX,AX
      AND DX,00FFH
      ADD BX,DX
      MOV DELAYTIME,BX
      LOOP IN1
  
  
   NXT:        MOV CX,DELAYTIME
          MOV DL,10
          MOV AH,02H
          INT 21H
  
  LEA SI,MSG1
  
  LP:    PUSH DX
      MOV DL,[SI]
      CMP DL,'$'
      JE NXT2
     MOV AH,02H
   INT 21H
   ADD SI,1
   POP DX
   MOV DI,DELAYTIME
   MOV AH, 0
   INT 1Ah
   MOV BX, DX  
  
   Delay:
   MOV AH, 0
   INT 1Ah
   SUB DX, BX
   CMP DI, DX
   JA Delay
  
   LOOP LP
  
      NXT2:   MOV AH,4CH 
               INT 21H
  
  
   END
  </code></pre>