Re: Euler Project Problems.
"Ray St. Marie" <[email protected]> Sun, 11 May 2008 17:53:45 -0600
| Newsgroups | gmane.comp.lang.forth.colorforth |
|---|---|
| Message-ID | <[email protected]> |
Thank you, both for this. Ray here... On Sat, May 10, 2008 at 2:35 PM, Gwenhwyfaer <[email protected]> wrote: > On 10/05/2008, Albert van der Horst <[email protected]> wrote: >> On Fri, May 09, 2008 at 04:38:47PM -0600, Ray St. Marie wrote: >> > I've spent a day trying to figure out how I will implement larger then >> > 32 bit ( 27 really) numbers in colorforth for Project Euler Problem 3. >> > >> > Find the Greatest Prime Factor of 600851475143. > >> There is a division operator that spans 2 registers, effectively >> doing the SM/REM action of ISO Forth in one instruction. >> That is 64 by 32 bit division. >> It is called IDIV > > Unfortunately, it only returns 32-bit (31-bit, if signed) results - > which means that determining whether 3 is a factor of the above number > will necessitate a true double-precision division (64/32 returning > 64). > > Regards > Gwenhwyfaer > I've been looking through Art of Assembley by Randel Hyde. There is plenty there for people like myself, interested in translating his work to colorForth assembler, and still on the green side of programming. The multi-precision chapters are worth a glance, if you are not aware of how to do this kind of thing. I've taken a weekend break from the 'challenge'. My wife goes to work tonight and I'll pick it up then. I still think I'll be going with the FPU for the mulitply and divide routines, and something like Randel's add/adc and sub/sbb routines, though for good messure I should do them all. I wanna be a programmer, after all. :-) Thanks again, Albert and Gwenhwyfer. Ray PS. There was something posted somewhere in our world with a course on writing linux drivers that I saw recently, and thought was fairly good for someone like me using colorForth. If I could just recall where I saw it... I'm thinking that 'that' and AoA are prob'ly good sources for getting things done in cF. If I find it.. or you find it... OH! pps: Dear Albert! What say you about possibly running the OkadWork.cf file, kernel section, through the ciasdis disassembler. Nick needs to know how to fix his display problem and he needs to look 'inside' the kernel in something a bit more rational then cf-HEX. Or, if you have a suggestion, I'm sure he'll be really glad to hear from someone that can help. -- Raymond St. Marie ii, colorforthray.info