What is .text and why sometimes the .text has an adress like .text 0x0100
? Also why on other example the .data has also an adress like
.data 0x200:
A:5
.space: 8
What is .text and why sometimes the .text has an adress like .text 0x0100
? Also why on other example the .data has also an adress like
.data 0x200:
A:5
.space: 8
.data is the section where all your data is. For example your variables etc.
The .text section is where your code is. This is everything that should run in the program.
The data sections and text sections are sometimes given an address to allow a certain amount of space for the data section. For example if you place the text section at 0x500 and the data section at 0x300, then you have 200 bytes of space for your variables and data.