flat assembler
Message board for the users of flat assembler.
Index
> Windows > last digit of big exponentations |
Author |
|
bitRAKE 06 Apr 2013, 10:56
Quote: My problem is that i need the last 10 digits but 10000000000 is too big for a 32-bit register, is there an easy solution? should i rewrite it using 64 bit registers? and how does mul and div instructions work in long mode? DIV does not support an immediate value. As for division by zero - watch in debugger and it will be very clear. EDX:EAX is divided by EDX - in the loop EDX probably gets smaller and smaller until zero. *Search the board for examples, and there is a tutorial on x86asm.net. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
06 Apr 2013, 10:56 |
|
edfed 06 Apr 2013, 19:15
you maybe can to that in floating point.
fp numbers supports up to 19 digits numbers. here, you cannot use edx as a divisor maybe cause it is the high part of the dividende also, it appears that even if it is overwriten, the edx value can be 0 during the division. you don't need to reset the edi registerto 100000000 every loop. what can be interresting is to try to read the edx value in the DIV#0! interupt. if it is 100000000, it can be a cool hardware bug... |
|||
06 Apr 2013, 19:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.