How are dw and dd different from db directives for strings?
<p>Let's say I want to define a initialized variable string before running my assembly program (in <code>section .data</code>). The variable I chose to create is called <code>Digits</code> and it is a string that contains all the hexadecimal symbols.</p>

<pre><code>Digits: db "0123456789ABCDEF"
</code></pre>

<p>I defined the variable with <code>db</code>, that means <em>define byte</em>. Does this mean that the <code>Digits</code> variable is of 8-bits long? This doesn't seem to have sense for me because:</p>

<p>Each character in the string is an ASCII character, therefore I will need 2 bytes for each character. In total, I would need 32 bytes for the whole string!</p>

<p>So what does it mean when I define the variable as <em>byte</em>? <em>Word</em>? <em>Double word</em>? I don't see the difference. Because of my misunderstanding, it seems to be redundant to tell the type of data you need for the string.</p>

<p><strong>PD</strong>: <a href="https://stackoverflow.com/questions/10168743/x86-assembly-which-variable-size-to-use-db-dw-dd">This question</a> didn't help me to understand.</p>