I would like to declare a vector in the .bss segment, but I am not sure how to do so. I would like the vector to have 30000 bytes.
I have tried to compile some C code into assembly, but I don't quite understand how the generated code works, the result is:
.bss
.align 32
.type v, @object
.size v, 2000
v:
.zero 2000
.section .rodata
I do not really understand all the instructions.
.bssdeclares that the following statements will describe a part of the bss section..align 32declares that this address should be aligned to 32 bytes. This is done to structure the RAM properly and prevent some misalignment issues.These declare the size and type of v object. The size is declared as 2000.
this is the actual allocation of space.
.zero 2000allocates 2000 bytes of zeroed memory which is pointed by thevlabel.By these you can do something like:
to allocate 30000 bytes in the most basic way.