Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #20296

Re: dynamically determine whether running on 32-bit or 64-bit platform

X-Received by 10.224.175.65 with SMTP id w1mr21471789qaz.7.1362502909736; Tue, 05 Mar 2013 09:01:49 -0800 (PST)
X-Received by 10.49.48.71 with SMTP id j7mr2552012qen.25.1362502909720; Tue, 05 Mar 2013 09:01:49 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!t2no9077259qal.0!news-out.google.com!q17ni604qal.0!nntp.google.com!dd2no7240742qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.forth
Date Tue, 5 Mar 2013 09:01:49 -0800 (PST)
In-Reply-To <alpine.BSF.2.00.1303051148030.69374@yoko.controlq.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=192.92.94.23; posting-account=Y7_CpgoAAAA3-ZDq-hH1r00pzIid9nBr
NNTP-Posting-Host 192.92.94.23
References <716dba7a-65b2-421f-8a0a-a69480c23fc4@googlegroups.com> <alpine.BSF.2.00.1303051148030.69374@yoko.controlq.com>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <0dec38fd-c8cb-45d1-bf61-e075e27607fc@googlegroups.com> (permalink)
Subject Re: dynamically determine whether running on 32-bit or 64-bit platform
From Bob Wilkinson <wilkinson.bob@gmail.com>
Cc rob@controlq.com
Injection-Date Tue, 05 Mar 2013 17:01:49 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.forth:20296

Show key headers only | View raw


On Tuesday, March 5, 2013 4:50:27 PM UTC, Rob Sciuk wrote:
> On Tue, 5 Mar 2013, Bob Wilkinson wrote:
> 
> 
> 
> > Date: Tue, 5 Mar 2013 08:38:35 -0800 (PST)
> 
> > From: Bob Wilkinson <wilkinson.bob@gmail.com>
> 
> > Newsgroups: comp.lang.forth
> 
> > Subject: dynamically determine whether running on 32-bit or 64-bit platform
> 
> > 
> 
> > I have some code which worked on older 32-bit processors but which gave incorrect answers on a 64-bit machine.
> 
> >
> 
> > I found out that I no longer had to use 2constant and fm/mod, and that if I use constant and /mod I get correct answers. Made sense after I had made the change.
> 
> >
> 
> > Is there a standard way to dynamically determine whether code is running on a 32-bit or 64-bit machine?
> 
> >
> 
> > I guess my code would look quite convoluted, however it is done? Maybe some pre-processing would give cleaner code?
> 
> >
> 
> > e.g. in pseudocode
> 
> >
> 
> > #if64bit
> 
> >  600851475143 constant penumber
> 
> > #else
> 
> >  3851020999 139 2constant penumber
> 
> > #endif
> 
> >
> 
> > ....
> 
> >
> 
> > #if64bit
> 
> >  /mod
> 
> > #else
> 
> >  fm/mod
> 
> > #endif
> 
> >
> 
> > Bob
> 
> 
> 
> Try:
> 
> 
> 
>  	1 CELLS .

Thanks for that - I can make that work :-)

Bob

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

dynamically determine whether running on 32-bit or 64-bit platform Bob Wilkinson <wilkinson.bob@gmail.com> - 2013-03-05 08:38 -0800
  Re: dynamically determine whether running on 32-bit or 64-bit platform Rob Sciuk <rob@controlq.com> - 2013-03-05 11:50 -0500
    Re: dynamically determine whether running on 32-bit or 64-bit platform Bob Wilkinson <wilkinson.bob@gmail.com> - 2013-03-05 09:01 -0800
  Re: dynamically determine whether running on 32-bit or 64-bit platform Coos Haak <chforth@hccnet.nl> - 2013-03-06 01:23 +0100

csiph-web