Home > Net >  equivalent of NASM's "dd" in Gnu Assembler
equivalent of NASM's "dd" in Gnu Assembler

Time:01-02

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

CodePudding user response:

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
  • Related