flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > Print out register values |
Author |
|
edfed 14 May 2010, 16:12
http://www.cplusplus.com/reference/clibrary/cstdio/printf/
maybe you don't push enough parameters on the stack. Code: mov ecx,5 mov eax,ecx push eax :s Code:
push dword 5
|
|||
14 May 2010, 16:12 |
|
masterducky 14 May 2010, 16:30
Yes of course, how could i forget it, it needs two arguments.
By the way it compiles rather this way: Code: push dword ptr 5 Thank you Ed! |
|||
14 May 2010, 16:30 |
|
LocoDelAssembly 14 May 2010, 16:47
Quote:
That will be equivalent to "push dword [5]" which is an assured crash in Windows and probably in many others OSes that never allocate too low addresses. |
|||
14 May 2010, 16:47 |
|
masterducky 14 May 2010, 18:40
Thanks for letting me know that.
|
|||
14 May 2010, 18:40 |
|
dosin 14 May 2010, 23:36
depending on what you want ..
This works. if your using visual c++ .. use the regs... to do the work ... then print with the standard lib outside the asm tags... Code: #include <stdio.h> int main() { int some_var=0; _asm { mov ecx, 5 mov eax, ecx mov [some_var],eax } printf("Value of some var: %i ",some_var); return 0; } |
|||
14 May 2010, 23:36 |
|
masterducky 15 May 2010, 04:09
Awesome, that's what i wanted to do.
Thank you Dosin! |
|||
15 May 2010, 04:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.