Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The GNU Assembler Preprocessor - <b>initialized data</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Initialized data
----------------

   These are the GASP directives for initialized data, and the standard
GNU assembler directives they expand to:

`.DATA EXPR, EXPR, ...'
`.DATA.B EXPR, EXPR, ...'
`.DATA.W EXPR, EXPR, ...'
`.DATA.L EXPR, EXPR, ...'
     Evaluate arithmetic expressions EXPR, and emit the corresponding
     `as' directive (labelled with LAB).  The unqualified `.DATA' emits
     `.long'; `.DATA.B' emits `.byte'; `.DATA.W' emits `.short'; and
     `.DATA.L' emits `.long'.

     For example, `foo .DATA 1,2,3' emits `foo: .long 1,2,3'.

`.DATAB REPEAT, EXPR'
`.DATAB.B REPEAT, EXPR'
`.DATAB.W REPEAT, EXPR'
`.DATAB.L REPEAT, EXPR'
     Make `as' emit REPEAT copies of the value of the expression EXPR
     (using the `as' directive `.fill').  `.DATAB.B' repeats one-byte
     values; `.DATAB.W' repeats two-byte values; and `.DATAB.L' repeats
     four-byte values.  `.DATAB' without a suffix repeats four-byte
     values, just like `.DATAB.L'.

     REPEAT must be an absolute expression with a positive value.

`.SDATA "STR" ...'
     String data.  Emits a concatenation of bytes, precisely as you
     specify them (in particular, *nothing is added to mark the end* of
     the string).  String and numeric constants: Constants for   
     details about how to write strings.  `.SDATA' concatenates multiple
     arguments, making it easy to switch between string
     representations.  You can use commas to separate the individual
     arguments for clarity, if you choose.

`.SDATAB REPEAT, "STR" ...'
     Repeated string data.  The first argument specifies how many
     copies of the string to emit; the remaining arguments specify the
     string, in the same way as the arguments to `.SDATA'.

`.SDATAZ "STR" ...'
     Zero-terminated string data.  Just like `.SDATA', except that
     `.SDATAZ' writes a zero byte at the end of the string.

`.SDATAC "STR" ...'
     Count-prefixed string data.  Just like `.SDATA', except that GASP
     precedes the string with a leading one-byte count.  For example,
     `.SDATAC "HI"' generates `.byte 2,72,73'.  Since the count field
     is only one byte, you can only use `.SDATAC' for strings less than
     256 bytes in length.


See Also: Constants

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson