title: x86 Nasm assembly - push'ing db vars on stack - how is the size known?
body: <p>I've come across some nasm assembly examples. This is a classic Hello World program:</p>
  
  <pre><code>; ----------------------------------------------------------------------------
  ; helloworld.asm
  ;
  ; This is a Win32 console program that writes "Hello, World" on one line and
  ; then exits.  It needs to be linked with a C library.
  ; ----------------------------------------------------------------------------
  
          global  _main
          extern  _printf
  
          section .text
  _main:
          push    message
          call    _printf
          add     esp, 4
          ret
  message:
          db      'Hello, World', 10, 0
  </code></pre>
  
  <p>One thing I do not understand is why is only four added to <code>esp</code> after printf is executed? 
  It's supposed to flush out the message var from the stack if I understand right. The whole db variable is pushed onto stack, and obviously it takes more than 4 bytes. (I've referred to the accepted answer to this question: <a href="https://stackoverflow.com/questions/19526725/what-is-the-syntax-to-define-a-string-constant-in-assembly">what is the syntax to define a string constant in assembly?</a>)</p>
  
  <p>I'm sure this is an extremely stupid question for an experienced assembly programmer.</p>