Domanda

I have a number 8 717 809 4592 that is stored in the registers edx, eax. The values are as such edx = x14 eax = 4c382800 So basically edx has the high order and eax has the low order. How do I save this number as an ascii string '87178094592' without using function calls?

È stato utile?

Soluzione

Use div to divide edx:eax by 10 and repeat.

Altri suggerimenti

You can divide an extended precision dividend by a 32 bit divisor. Start with edx = 0, eax = high order dividend, divide by 10, high order dividend = eax, eax = low order dividend, divide by 10, low order dividend = eax, least significant digit = remainder = edx. Repeat until dividend = 0. You get the digits in reverse order, so you may want to push them onto a stack, the pop them off to get the digits in forward order, or store the digits into to a string array, starting at the end of the string (leaving room for a trailing zero).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top