title: How do I use a buffer in an assembly procedure?
body: <p>So, I understand the general abstract concept of a buffer: it's an allocation in memory that holds data before it gets processed. I'm trying to complete a homework problem which requires me to write an ASCII string into a buffer within a procedure. So, I understand that I'm supposed to pass an address of an array to the procedure when calling it, for example...</p>
  <pre><code>main PROC
  mov  EAX, packed           ; pass a packed decimal to EAX
  mov  ESI, OFFSET ascArray  ; pass the offset of an empty array to ESI
  call PackedToAsc           ; call the function
  </code></pre>
  <p>So the function is supposed to return 'a pointer to a buffer with the ASCII decimal string'. I'm probably being stupid here, but I'm not quite clear on what exactly a buffer is in this instance.</p>
  <ul>
  <li>Is it an array?</li>
  <li>Do I need to declare it as such in the <code>.data</code> section?</li>
  <li>How do I declare the pointer to the ASCII string inside the procedure?</li>
  <li>What is meant by a buffer in this context?</li>
  </ul>
  <p>More practically, I need to access the buffer that the data is put into when the procedure finishes, and I'm not sure how to do that.</p>
  <p><strong>EDIT</strong>
    --    I'm in x86, and I'm using MASM.</p>