title: Assembly: Changing character in string
body: <p>I'm trying to change a string of numbers like '00000000$', and then print the string to a file.</p>
  
  <p>For example when I use something like this:</p>
  
  <pre><code>nr  db '00000000$'  
  
  
  asdf PROC near
  
  mov bx, offset nr
  add bx, 7
  mov [bx], '0'
  dec bx
  mov [bx], '4'
  dec bx
  mov [bx], '0'
  dec bx
  mov [bx], '3'
  dec bx
  mov [bx], '0'
  dec bx
  mov [bx], '2'
  dec bx
  mov [bx], '0'
  dec bx
  mov [bx], '1'
  ret
  
  asdf ENDP
  </code></pre>
  
  <p>and then print it to file with:</p>
  
  <pre><code>mov bx, FHandle
  mov cx, 8
  mov ah, 40h
  int 21h
  </code></pre>
  
  <p>I get a file with '2' and 7 spaces printed after it.
  I'm not sure if I'm doing the printing wrong, or if I'm changing the string wrong.</p>