flat assembler
Message board for the users of flat assembler.
Index
> Windows > scanf troubles |
Author |
|
ctl3d32 24 May 2011, 19:42
Hi! These should be changed:
Code: push [_Number1] push [_Number2] call Addition push eax push [_Number1] push [_Number2] push _Result call [printf] |
|||
24 May 2011, 19:42 |
|
mindcooler 24 May 2011, 19:44
Code: push _Number1 push _Number2 You're pushing the addresses of your variables, not their values. Code: push [_Number1] push [_Number2] call Addition push eax push [_Number1] push [_Number2] push _Result call [printf] _________________ This is a block of text that can be added to posts you make. |
|||
24 May 2011, 19:44 |
|
DStevens5833 24 May 2011, 19:52
Such a simple mistake! It works now; thank you both for your help!
|
|||
24 May 2011, 19:52 |
|
LocoDelAssembly 24 May 2011, 20:51
In this particular case nothing will blow up but you should use "add esp, total_size_of_arguments" after each call to msvcrt functions (and wsprintf), where total_size_of_arguments in all your cases is the number of PUSHes multiplied by 4. (Using cinvoke would do this automatically for you as long as all the parameters are specified in the cinvoke call and not some of them pre pushed.)
|
|||
24 May 2011, 20:51 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.