title: Regarding 8086 assembly's DB and DUP directives
body: <p>So I've encountered a problem that made me question my basic understanding of the <code>DB</code> (define byte) and <code>DUP</code> (duplicate) directives. The way I've understood them is:  </p>
  
  <ul>
  <li><code>NUM DB 34</code> will create a variable named <em>NUM</em> and it will assign it with the value 34. Like C <code>char NUM = 34;</code><sup>1</sup></li>
  <li><code>NUM DB 34 DUP(?)</code> will give me an array of 34 items, each of them unassigned.  </li>
  <li><code>NUM DB 3 DUP(4)</code> would give me an array called <em>NUM</em> with 3 items: 4, 4, 4.</li>
  </ul>
  
  <p>Is this correct?</p>
  
  <p>In my textbook I encountered:</p>
  
  <blockquote>
  <pre><code>PRINT_SELECT DB 133 (?)
               DB 123 (?)
  </code></pre>
  </blockquote>
  
  <p>Is this just a mistake in the textbook, or do these two lines of code mean something else completely?</p>
  
  <hr>
  
  <p>Footnote 1:  (editor's note): <code>NUM = 34</code> in asm defines an assemble-time constant not stored in data memory.  In MASM-syntax assemblers, it works similarly to a variable in some contexts.  But for example <code>mul NUM</code> only works with a memory source, not an immediate, while <code>imul eax, ecx, NUM</code>, or <code>shl ax, NUM</code>, or <code>mov ax, NUM / 2</code> only works with an immediate, not a memory source.</p>