Hello and thanks for reading!
Windows 64 / Nasm x86 / gcc
A friend helped me with some code and he used ebp-4/ebp-8 to store temporal variables, I thought it would make it more readable to allocate variables in .bss section and use them. Later, I thought I didn't want to have too many variables in .bss section and decided to go back to my friends implementation, also, at that time, my brain already started to like to use ebp-X to store temporal variables.
Linux 64 / Nasm x86 / gcc
Segmentation fault, and I didn't know why for a really long period of time. it occurred to me, as a last resort, to create variables for ebp-4 and others. That made it, no more segmentation fault; but I'm still curious about why did this happened? Why couldn't I use ebp-4 to store temporal variables on Linux when on Windows it was just fine?
nasm -f elf32 -o
gcc -m32 -o
%macro HexToBin 3
...;code
...
mov dword [ebp-4], dword 0 ; Segmentation fault
...
...;code
%%hextobinE:
%endmacro