Go to the first, previous, next, last section, table of contents.

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). See section String and numeric 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.


Go to the first, previous, next, last section, table of contents.