ASM Newbie Question: 10/6 Byte Division

  • Thread starter Thread starter Brazilian Fan
  • Start date Start date
  • Tags Tags
    Division
AI Thread Summary
To divide a 10 by 6 byte number using assembly language, one approach is to apply long division, similar to the method taught in grade school. This is necessary because the DIV or IDIV opcode is limited to handling 8 by 4 byte divisions. Extended precision math can complicate the process, and resources such as Apfloat provide documentation and source code to assist with these calculations.
Brazilian Fan
Messages
2
Reaction score
0
Hi, I am new here and I got a newbie ASM Question:

How to divide, say, a 10 by 6 bytes number if the DIV (or IDIV) opcode only supports a 8 by 4 Bytes division?

Thanks in advance
 
Last edited:
Technology news on Phys.org
One way would be to simply use the same algorithm you used in grade-school for long division.

- Warren
 
Extended precision math can get tricky. Here's a link to a website that includes source and documentation:

http://www.apfloat.org
 
Thanks for the help :smile:
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top