I want to know what is the difference between the data section and text section in terms of the entire code in a specific section.
I was trying to run the code I have added here. In the data sectoin it runs and prints "af)a" If I change it to the text section in line 2, it seg fault.
I can't figure out what are the crucial differences. Thanks :)
global _start
section .data
_start: mov ecx, 3
xor byte [_start + 1], 0x02
pushad
mov eax, 4
mov ebx, 1
mov edx, ecx
mov ecx, dword blah
int 0x80
blah: popad
sub bx, ax
loop _start
mov eax, 1
mov ebx, 2
int 0x80
fin:
expected code to yield the same result, but was proven otherwise.