From: IN%"davek@peg.pegasus.oz.au" 18-JUN-1992 14:12:11.17 To: matejowsky@qut.edu.au CC: Subj: Forth suggestions Received: from munnari.oz.au by qut.edu.au; Thu, 18 Jun 92 14:11 +1000 Received: from peg.pegasus.oz (via basser) by munnari.oz.au with SunIII (5.64+1.3.1+0.50) id AA21563; Thu, 18 Jun 1992 14:12:22 +1000 (from davek@peg.pegasus.oz.au) Received: from peg.UUCP by swift.sw.oz.au with UUCP id AA12559; Thu, 18 Jun 92 14:09:15 AES (5.59) (from davek@peg.pegasus.oz.au for matejowsky%qut.edu.au@munnari.cs.mu.oz.au) Date: Thu, 18 Jun 92 14:09:15 AES From: davek@peg.pegasus.oz.au Subject: Forth suggestions To: matejowsky@qut.edu.au Message-id: <9206180409.AA12559@swift.sw.oz.au> X-Envelope-to: matejowsky Suggestions (this document is formatted for tab = 4) ----------- In the synopsis, we should separate all the assembler stuff from all the high level stuff. Comment in BASE^I source is wrong. Are names ^I and X^I and EXP appropriate? What about F^I, I^I and just ^ ? And what about I^I with an integer result? How about: Result Base Exponent Suggested name Current name int int int ^ (not defined) float float float F^ (not defined) float float int F^I X^I float int int FI^I ^I How about FX instead of EXP since EXP usually means e^x ? Instead of F1<-1 how about FABS1< ? How about FDEGTORAD and FRADTODEG instead of DEG>RAD and RAD>DEG since > inside other words already means either "greater than" or "move to/from non-data stack". I think all words which take a floating point argument or give a floating point result should start with F. eg. F10^I, FBASE^I, FX, FCOS, FSIN, FTAN, FDEGTORAD, FRADTODEG, FPI. I guess if we ever implement double precision floats the words should be prefixed by FD since D is already standard for double precision integers. How about FONE instead of FPONE, to be consistent with the above ? How about FLOAT instead of FPU as the name of the vocabulary since it really has nothing to do with the existence or otherwise of an FPU? You might implement them for a T4xx or even a non transputer one day. FPUASM is of course quite appropriate provided it does not contain the non-FPU floating point support instructions of the T4xx. I32TOR32 should probably be ITOF. R32TOI32 should probably be FTOI. Should #.#> and .ETC have an F in front of them? Faulty comments on 2*, AND, OR, XOR. REV16 and REV32 should be BITREV16 and BITREV32 to avoid confusion with the transputer REV instruction which swaps the top two CPU stack items, and to associate them with the transputer BITREV instructions which they are based on. Add ENDIF as an alias for THEN. In a comment, ALTERATE is misspelled, should be ALTERNATE. Change DEBUGSTUFF to DEBUG and DEBUG TO TRACE and hide --> and D.S. Removed SAVEMODE from synopsis - maybe HIDE it. Change W,CON to WS,VAR, likewise [WS,VAR]. Reverse the order of arguments to ALIAS so it is like other defining words where the word being defined appears immediately after the defining word. Make MACRO an alias for : and use MACRO where appropriate. Put a return after : POP so the DUP is on a new line. Put a blank line before : PROGRAM. Change PUSH to A>PUSH. Change POP to POP>A. Where "A" can be thought of as standing for "'A' register" or "Accumulator" or "ALU". I realised that A> and >A are not appropriate names for what I now want to call A>PUSH and POP>A since they take the address of a stack pointer as a parameter. If we were to define A> and >A they would be : A> SP A>PUSH ; : >A SP POP>A ; Currently Suggestions in order of decreasing favour Pronounced as --------- ----------------------------------------- ------------- PUSH A>PUSH PUSHA> PUSHFROMA PUSHA A to push or Push from A POP POP>A POPTOA POPA Pop to A PUSHFPA FPA>PUSH PUSHFPA> PUSHFROMFPA PUSHFPA FPA to push or Push from FPA POPFPA POP>FPA POPTOFPA POPFPA Pop to FPA POP, POP (comma dropped) with ADROP as an alias REV REV (no change) with ASWAP as an alias DUP, DUP, (no change) with ADUP as an alias FPDUP FPDUP (no change) Change ALIGN to DPALIGN. (ALIGN doesn't appear in any of the forth books I have). Clear the transputer's error flag at startup? Why does it end up set? Remove the definition and call of SHIT. Change RUNHI and [RUNHI] to FORKHI and [FORKHI] (you did RUN but not RUNHI).