Search code examples
assemblynasmgnu-assembler

equivalent of NASM's "dd" in Gnu Assembler


I'm trying to translate dd from NASM (or MASM) to GAS.
I can't find it anywhere in the manual.


Solution

  • In NASM, the dd pseudo op defines a "double word" (e.g. 4 byte integer):

    http://www.tortall.net/projects/yasm/manual/html/nasm-pseudop.html
    https://nasm.us/doc/nasmdoc3.html#section-3.2

    ; Example:
    dd      0x12345678          ; 0x78 0x56 0x34 0x12
    

    In Gas, the corresponding directive would typically be .long:

    https://sourceware.org/binutils/docs/as/Long.html

    ; example:
    dimensions:
      .long 0, 0