title: Down Convert DWORD to BYTE, Assembly 32 bits
body: <p>I would like to down convert Dword to Byte so that I can store it to a textfile in readable text by <code>call WriteToFile</code>. How can I do it?</p>
  <pre><code> .386     
   .model flat, stdcall  
   INCLUDE Irvine32.inc
   .stack 4096  
  
   .Data
   total         DWORD  ?      ;total is a variable which holding a math calc output
   totalTXT       BYTE  ?      ;totalTXT would be the output in String value. 
      
  </code></pre>
  <p>Here is where i try to downcast the conversion</p>
  <pre><code> xor eax, eax
   mov eax,  total
   mov totalTXT, al
  </code></pre>
  <p>I need totalTXT in byte so I can store into file as text. But After debugging, my textfile become empty.</p>
  <pre><code>WRITE_TO_FILE:                 ;assume file is successfully opened
  
   mov eax,fileHandle 
   mov edx, OFFSET   totalTXT          
   mov ecx, LENGTHOF totalTXT   
   call WriteToFile
   call CloseFile
  </code></pre>