title: How can I read the contents from a file whose name I receive in the command line in ASM
body: <p>I want to read the name of a file from the command line. The name is stored in var4, then I read from the file whose name I received  and store the text inside it in var2. Then I want to display the contents from the file. When I give the name directly, without using the command line (storing the name in var1, and then opening the file with that name) it works correctly. But when I use the name I received in the command line, even though they have the same name, it doesnt work. How can I fix this. 
  I am using TASM</p>
  
  <pre><code>datos segment
  var3 db 128 dup(0)
  var2 db 128 dup(0)
  handle dw 0
  var1 db "c:\xxx.txt",0
  var4 db 10 dup(0)
  
  datos ends
  
  pila segment stack "stack"
  dw 256 dup(?)
  pila ends
  
  
  codigo segment
  assume cs:codigo, ds:datos, ss:pila
  
  inicio:
       mov ax,ds
       mov es,ax
  
       mov ax, datos
       mov ds,ax
  
       mov ax,pila
       mov ss,ax
  
  
  
       mov si, 80h
       mov cl, byte ptr es:[si]
       xor ch, ch
  
       xor di, di
       inc si
  ciclo: inc si
        mov al, byte ptr es:[si]
        mov byte ptr var4[di], al
        inc di
  
        loop ciclo
        mov byte ptr var4[di],0
  
  
        mov ah,3dh
        lea dx,var4
        mov al,00h
        int 21h
        mov word ptr handle ,ax
  
        inc di
        mov byte ptr var4[di],0dh
        inc di
        mov byte ptr var4[di],0ah
  
        mov ah,3fh
        mov bx, handle
        mov cx,100h
        lea dx,var2
        int 21h 
  
        xor si,si
        xor di,di
        mov cl,ds:[si]
  
      ciclo2: 
        mov al, byte ptr var2[si]
  
        mov byte ptr var3[di], al
       inc si
       inc di
      loop ciclo2
        mov byte ptr var3[di],'$'
  
  
       mov ah,09h
       lea dx,var3
       int 21h
  
       fin:
       mov ax,4C00H
       int 21h
   codigo ends
  
   end inicio
  </code></pre>