Table of Contents

Data allocation (ivss)

Data allocation emits initialized bytes or reserves zero-filled space in the current section. ivss supports several widths and a string directive:

.section my_data
    .byte 0x41
    .half 0x1234
    .word 0x11223344
    .skip 3
    .ascii "Hi"

The resulting bytes are:

41 34 12 44 33 22 11 00 00 00 48 69 00

For numeric literals, .byte, .half, and .word emit one, two, and four bytes respectively. Multi-byte data is little-endian, placing the least significant byte first. .skip 3 appends three zero bytes.

The string helper used by .ascii appends a terminating zero, so "Hi" occupies three bytes in this implementation. Do not infer its behavior from assemblers where .ascii excludes that terminator.

The directives append without automatically padding this layout for alignment. Labels can name any of these offsets for later access. Symbol-valued data operands additionally involve relocation; the example uses numeric literals so each displayed byte is determined during assembly.

Source: asembler.c, elf.c.