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 have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top