I am starting to learn assembly by storing the ESP register before calling the function, does it matter if you do this by adding or subtracting? difficult to explain, consider the following
mov esi, esp sub esp, 12 // on 32bit OS this would mean that there are 3 arguments to the function // push, function call etc cmp esi, esp // should be the same
or
mov esi, esp // push, function call etc add esp, 12 cmp esi, esp // should be the same
Also, if for some reason cmp fails, is it safe to use mov esp, esi to align the stack?
thank
EDIT: And how do I need to do this to call a sprintf type, but the MessageBox seems to fix the ESP for me? How do I know which function needs this and what not?
, esp ( , , - , , ). , . , ( ), stac k. X86 ( ) . ... , .
, esp, , , , , - , , . esp esi ... esp esi, , , , esp , .
MessageBox - " ". (C), . sprintf cdecl, MessageBox - stdcall.
sprintf, MessageBox, , ESP ?
, MessageBox() , . , .
MessageBox()
sprintf() . , , .
sprintf()
Source: https://habr.com/ru/post/1736582/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1736577/scons-copy-external-libraries-to-build-output-directory&usg=ALkJrhgKOahmXIYn1g5X5Rgoqqsd9Ert4wConcurrent reading and writing to NamePipeClientStream - multithreadingAutocac Wcf Integration Security Issue - autofacPassing values through files in C ++ - c ++Вступление в COM DLL - windowsIs there a lightweight script 2d world? - game-engineXSL transformation generating output from other nodes - xmlкак напечатать char из struct - cPHP: визуальная разница между двумя массивами - arraysWhat is the weirdest event when UIButton @selector detected the right button, making the wrong "else_if"? - objective-cAll Articles