title: DUP directives assembly language allocates space and fill the space with characters
body: <p>I am doing my assembly language assignment and came across some problems.
  The question is: Using DUP directive, allocate space for 5 doublewords and 2 bytes in a data segment. then, fill the next 15 spaces with the character&amp;, the 7 spaces that follow with the character% and the space after that with the character capital M.</p>
  
  <p>I have 2 answers for this:</p>
  
  <pre><code>.data?
  var1 DWORD 5 DUP (?)
  var2 BYTE 2 DUP(?)
  15 DUP (“&amp;”)
  7 DUP (“%”)
  1 DUP (“M”)
  
  .data?
  var1 DWORD 5 DUP (?)
  var2 BYTE 2 DUP(?)
  5 DUP (3 DUP(“&amp;”), ("%"))
  2 DUP (“%”)
  1 DUP (“M”)
  </code></pre>
  
  <p>My questions: </p>
  
  <ol>
  <li><p>Are these correct?</p></li>
  <li><p>When defining data, do I need to care about how many bytes each data type can hold? From textbook, I saw something like this BYTE 4 DUP ("STACK"), and it holds 20 bytes. The question above asked to allocate spaces, what I think is I allocate 5 doubleword = 20 bytes and 2 byte = 2 bytes, in total is 22 bytes, but there are 23 characters to store. Did I understand the question wrongly? </p></li>
  </ol>
  
  <p>Thank you in advance if you spend your time reading my question. </p>