-2

.data 0x10000000 .align 2 Array: .word 3 6 9 12 15 18 21 24 Size: .word 8 Result: .word 0

So what does ".data" mean exactly and does "Size" correspond to the size of "Array" or is it simply another variable?

Also, what does "Result" mean? Is it an array of one character, which is 0?

June
  • 27
  • 4

1 Answers1

0

.data is a header that is required before allocating memory for your program and specifying memory formatting. The header .text is required before program functions are written. The label main: must be placed somewhere under .text to indicate the starting location of the program.

Array:, Size:, and Result: are user defined labels and haven't allocated memory.

For that use .space "# of bytes", not .word.

geg
  • 4,399
  • 4
  • 34
  • 35