Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Multiplying our way out of division (xania.org)
9 points by HeliumHydride 7 days ago | hide | past | favorite | 1 comment




Reversing the numbers as required here is one of the few algorithms thats nicer in assembly than in a high level language:

When you get a digit from the divide, push it on the stack and increment a counter. At the end, do a loop, popping each digit and sending it to the output.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: