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, ...
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
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" ...
.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" ...
.SDATA
.
.SDATAZ "str" ...
.SDATA
, except that
.SDATAZ
writes a zero byte at the end of the string.
.SDATAC "str" ...
.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.