Path: utzoo!yunexus!ists!jarvis.csri.toronto.edu!mailrus!ames!amelia!eos!jbm From: jbm@eos.UUCP (Jeffrey Mulligan) Newsgroups: comp.lang.forth Subject: Re: Forth Implementation (long) Keywords: Forth implementation Message-ID: <5599@eos.UUCP> Date: 17 Nov 89 22:58:58 GMT Article-I.D.: eos.5599 References: <5172@sdcc6.ucsd.edu> Organization: NASA Ames Research Center, California Lines: 34 ir230@sdcc6.ucsd.edu (john wavrik) writes: Interesting posting... but I found the following bits a little inconsistent: >Please note that the problem is to add the data type "long" in such a way that >it has the same status as built-in types. Treating a "long" as an array or a >"struct" and defining functions like long_add would not do! later: >Let's look at the task of defining a double-precision addition in Forth. Here >is the definition in F-83 due to Henry Laxen: > >\ 32 bit Arithmetic Operations 11OCT83HHL > CODE D+ (S d1 d2 -- dsum ) > AX POP DX POP BX POP CX POP CX DX ADD BX AX ADC > 2PUSH END-CODE Isn't having a special word "D+" for adding doubles (instead of using "+") equivalent in a sense to having a special function long_add? You made a point in the C example of pointing out that the compiler has to be able to add double precision to single precision integers; Does this require yet another forth word, or do you have to do it as a series of two operations, a type conversion followed by D+ ?? -- Jeff Mulligan (jbm@aurora.arc.nasa.gov) NASA/Ames Research Ctr., Mail Stop 239-3, Moffet Field CA, 94035 (415) 694-3745