title: Split strings on Assembly x86 16-bit
body: <p>I'm trying to write a program that reads 3 strings from the keyboard and then display 2 strings in lowercase and the last one in uppercase. Here's what I've got till now: I can read the string, but then it converts everything to uppercase. Is there anyway to convert only the last string? Thanks in advance</p>
  
  <pre><code>.MODEL SMALL
  .DATA
      MSG  DB  0DH,0AH, 'ENTER A STRING: $'
      MSG2 DB  0DH,0AH, ' YOUR STRING IS  :-----&gt; :  $'
      STR1 DB  255 DUP(?)
  .CODE
  BEGIN:
  
      MOV AX,@DATA
      MOV DS,AX
  
      LEA DX,MSG  
      MOV AH,09H
      INT 21H
  
      LEA SI,STR1 
      MOV AH,01H
  
  READ:
      INT 21H 
      ;MOV BL,AL
  
      CMP AL,0DH
      JE  DISPLAY
  
      SUB AL,20H
      MOV [SI],AL
      INC SI
  
      ;CMP BL,0DH
      JMP READ
  
  DISPLAY:
  
      MOV AL,'$'  ;caracter '$'
      MOV [SI],AL ;
  
      LEA DX,MSG2 
      MOV AH,09H  
      INT 21H 
  
  
      LEA DX,STR1 
      MOV AH,09H  
      INT 21H
  
      ; MOV AH,4CH
      ; INT 21H
  
  .EXIT
  END BEGIN
  </code></pre>
  
  <p>I'm using TASM.</p>