Usually to print on screen a integer of 2 numbers i divides it for 10 and then use int 21h with mov ah,2 to print the 2 results.

However with integers with more than 2 numbers it starts getting complicated and the method i use becomes really too long . So is there a method to fast write long integer on screen?

Recommended Answers

All 2 Replies

Hi to all,
This is a question that arises many times.
In another place, I have answered this question. You can see the answer at:
http://www.programmingforums.org/thread30456.html

As you can see, you divide the number by 10 and save the remainder in the stack and increment the counter. You must do this repeatedly until the number becomes lower than 10. You push it another time and increment the counter. After that, the numbers will exit from the stack in the correct way. In the example I convert them to an string.
I hope that this can be useful.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.