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?

7 Years
Discussion Span
Last Post by untio

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:

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.