Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.
I'm trying to write a program to multiple two 10 digit numbers using arrays in MASM. I have no idea where to start. I can do like adding in the arrays, but nothing like multiplication.
Hmm, okay, well if you can do addition, surely you can do multiplication, since n * m = n + n + ... + n (m times). So write a loop (which you should know how to do in MASM) and run your addition code in that loop.
Hmm, okay, well if you can do addition, surely you can do multiplication, since n * m = n + n + ... + n (m times). So write a loop (which you should know how to do in MASM) and run your addition code in that loop.
That is EXTREMELY slow. Given that he is using masm, I'm going to assume that this is the x86 architecture. With that in mind, there is a multiplication instruction.
*edit*Err um, ignore the above, I just realized what he meant by multiplying ten digit numbers
Barring that, the RPN is an extremely fast and easy to implement algorithm that only uses bitshifts and addition. (dividing by two is a bitshift left.) It isn't the fastest algorithm, but it isn't fast enough for most applications. http://mathforum.org/dr.math/faq/faq.peasant.html
As for IO, use the C standard io library. There is no reason to write your own.
I guess the issue you're running into is you have ascii numbers and want to do floating point math. In a c/c++ env you would use atof() or so to convert to a double and then use the floating point unit.
If you are so inclined you're going to have to write your own ascii to float and float to ascii or do a very large cross multiply.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.