flat assembler
Message board for the users of flat assembler.
Index
> Windows > Write modulo result |
Author |
|
AsmGuru62 05 Sep 2012, 16:11
MOVE EAX,NUM1
|
|||
05 Sep 2012, 16:11 |
|
TmX 06 Sep 2012, 06:08
Still yields the wrong result... :/
|
|||
06 Sep 2012, 06:08 |
|
sinsi 06 Sep 2012, 06:26
Brackets.
|
|||
06 Sep 2012, 06:26 |
|
TmX 06 Sep 2012, 08:02
You mean like this?
Code: xor edx, edx mov eax, num1 mov ecx, num2 div ecx cinvoke printf, fmt, [edx] The output is 1234. The reminder of a DIV operation is stored in EDX, right? http://css.csail.mit.edu/6.858/2011/readings/i386/DIV.htm |
|||
06 Sep 2012, 08:02 |
|
revolution 06 Sep 2012, 08:05
num1 is a pointer. But we assume you actually want the number stored at num1, is that correct? If so then:
Code: mov eax,[num1] |
|||
06 Sep 2012, 08:05 |
|
AsmGuru62 06 Sep 2012, 10:24
And brackets on num2 also.
|
|||
06 Sep 2012, 10:24 |
|
TmX 06 Sep 2012, 15:13
Code: xor edx, edx mov eax, [num1] mov ecx, [num2] div ecx cinvoke printf, fmt, edx invoke ExitProcess, 0 works as expected. thanks |
|||
06 Sep 2012, 15:13 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.