GNU Info

Info Node: (nasm.info)Section 3.4.3

(nasm.info)Section 3.4.3


Next: Section 3.4.4 Prev: Section 3.4.2 Up: Section 3.4
Enter node , (file) or (file)node

3.4.3. String Constants
-----------------------

   String constants are only acceptable to some pseudo-instructions,
namely the `DB' family and `INCBIN'.

   A string constant looks like a character constant, only longer. It is
treated as a concatenation of maximum-size character constants for the
conditions. So the following are equivalent:

           db    'hello'               ; string constant
           db    'h','e','l','l','o'   ; equivalent character constants

   And the following are also equivalent:

           dd    'ninechars'           ; doubleword string constant
           dd    'nine','char','s'     ; becomes three doublewords
           db    'ninechars',0,0,0     ; and really looks like this

   Note that when used as an operand to `db', a constant like `'ab'' is
treated as a string constant despite being short enough to be a
character constant, because otherwise `db 'ab'' would have the same
effect as `db 'a'', which would be silly. Similarly, three-character or
four-character constants are treated as strings when they are operands
to `dw'.


automatically generated by info2www version 1.2.2.9