title: While using DOSBox, if I try running my code with debugger it works, while without using debugger my code does not run?
body: <p>While using DOSBox, if I try running my code with the debugger it works, while without using debugger my code does not run and execute the way it did when I used debugx. Why does this happen?</p>
  
  <p>The question is:</p>
  
  <blockquote>
    <p>Write an ALP that will take in a single user input a number between (0-9). If the user for e.g. enters 5 then the 5th character in file tab.txt must be exchanged with the 5th character in file lab.txt. The size of files is variable but definitely greater than 10 bytes. The user input must not be displayed on the screen.</p>
  </blockquote>
  
  <pre><code>.model tiny
  .486
  .data
  
   file db 'lab.txt',0
   handle dw ?
   buffer db 1 dup(?)
   fil db 'tab.txt',0
   han dw ?
   buffer1 db 1 dup(?)
   imp db ?
   .code
   .startup
  
  lea si,imp
  mov ah,08h
  int 21h
  and al,0fh
  dec al
  mov [si],al
  
  mov ah,3dh
  mov al,2
  lea dx,file
  int 21h
  mov handle,ax
  
  mov ah,3dh
  mov al,2
  lea dx,fil
  int 21h
  mov han,ax
  
  mov al,0
  mov bx,handle
  mov cx,0
  mov dx,[si]
  mov ah,42h
  int 21h
  
  mov al,0
  mov bx,han
  mov cx,0
  mov dx,[si]
  mov ah,42h
  int 21h
  
  mov     ah,03fh
  mov     bx,handle
  mov     cx,1
  lea     dx,buffer
  int     21h
  mov     ah,03fh
  mov     bx,han
  mov     cx,1
  lea     dx,buffer1
  int     21h
  
  mov al,0
  mov bx,handle
  mov cx,0
  mov dx,[si]
  mov ah,42h
  int 21h
  
  mov al,0
  mov bx,han
  mov cx,0
  mov dx,[si]
  mov ah,42h
  int 21h
  
  mov     ah,40h
  mov     bx,handle
  mov     cx,1
  lea     dx,buffer1
  int     21h
  
  mov     ah,40h
  mov     bx,han
  mov     cx,1
  lea     dx,buffer
  int     21h
  
  
  mov     bx,handle
  mov     ah,03eh
  int     21h
  mov     bx,han
  mov     ah,03eh
  int     21h
  
  .exit
   end
  </code></pre>