x86 Assembly

Moderators: None (Apply to moderate this forum)
Number of threads: 4563
Number of posts: 16029

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Re: Converting number to string Posted by AsmGuru62 on 17 Jun 2001 at 11:12 AM
: hi everybody
: how do I convert in assembly a number ( 0 - 4321078) to a string ?
: Merci
: Bodo
:
:

You can divide it by 10 repeatedly and store a remainder as a digit char starting from the end of the buffer:

1024/10 = 102 and 4 -> make '4' and store it
102/10 = 10 and 2 -> make '2' and store it
10/10 = 1 and 0 -> make '0' and store it
1/10 = 0 and 1 -> make '1' and store it -> done...





Thread Tree
Bodo Converting number to string on 17 Jun 2001 at 10:43 AM
AsmGuru62 Re: Converting number to string on 17 Jun 2001 at 11:12 AM
Bodo Re: Converting number to string on 18 Jun 2001 at 10:04 AM
AsmGuru62 Re: Converting number to string on 18 Jun 2001 at 10:28 AM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.