The following code allocates a global array numbers that has
enough room for 200 integers:
numbers_itemsize = 4 # each item in this array requires 4 bytes numbers_numitems = 200 # a total of 200 items in this array .data numbers: .fill numbers_itemsize * numbers_numitems
In this definition, it may seem tedious and unnecessary to define the
symbolic names numbers_itemsize and numbers_numitems.
However, these two definitions let us easily change the array size
either due to the size of each item, the number of items, or both.
To allocate an array on the stack (as a local variable), we can do the following instead:
numbers_itemsize = 4 # each item in this array requires 4 bytes numbers_numitems = 200 # a total of 200 items in this array numbers = prev_item - numbers_itemize * numbers_numitems # ... more local variable definitions