I've tried declaring variables in .text
segment using e.g. file_handle: dd 0
.
However, trying to store something in this variable like mov [file_handle], eax
results in a write error.
I know, I could declare writeable variables in the .data
segment, but to make the code more compact I'd like to try it as above.
Is the only possibility to use the stack for storing these value (e.g. the file handle), or could I somehow write to my variable above?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…