🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.language.basm
Article #10

Re: Better IntToStr? What do ya think

#10
From: Colin B Maharaj
Date: Wed, 20 Jun 2007 01:42
24 lines
2017 bytes
Bob Gonder wrote:

> So, you write to string in reverse order, then strrev()

The beautiful thing about this, is that internally
strrev requires that it knows the beginning and end
of a string that it's going to reverse.

And this is exactly what you have when you do the
conversion, the start and end of the resulting 'string'.
So the strrev type code, in ASM, is the natural path.

I was trying to do another method without reversing
using logarithms, but I have not figured it out yet and
somehow I feel the log 10 will take up too much cycles.
And then you cannot log zero or a negative number so
it gets more complex (more preconditions)

> Another way is to push the digits onto stack, then pop/store to
> string.

Then you will need to find a way to keep track of how
much popping required, maybe this might less elegant
but who knows.
Technical Details
Message-ID: <467885ef$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4677c279$1@newsgroups.borland.com> <k9cg73tlrfbafr87n8ee6in36vutvjjcvb@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 107b11,967a3c560bdbf1af
X-Google-Attributes: gid107b11,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 19 Jun 2007 21:42:09 -0400
From: Colin B Maharaj <noreply@myhost.com>
User-Agent: Thunderbird 1.5.0.12 (Windows/20070509)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.language.basm
Subject: Re: Better IntToStr? What do ya think
References: <4677c279$1@newsgroups.borland.com> <k9cg73tlrfbafr87n8ee6in36vutvjjcvb@4ax.com>
In-Reply-To: <k9cg73tlrfbafr87n8ee6in36vutvjjcvb@4ax.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 000750-2, 06/19/2007), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 190.58.14.113
Message-ID: <467885ef$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1182303727 190.58.14.113 (19 Jun 2007 18:42:07 -0700)
Lines: 29
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail