Diff for /gforth/Attic/primitives between versions 1.22 and 1.23

version 1.22, 1994/10/24 19:16:05 version 1.23, 1994/10/27 16:32:22
Line 3 Line 3
 \ WARNING: This file is processed by m4. Make sure your identifiers  \ WARNING: This file is processed by m4. Make sure your identifiers
 \ don't collide with m4's (e.g. by undefining them).  \ don't collide with m4's (e.g. by undefining them).
 \   \ 
   \ 
   \ 
 \ This file contains instructions in the following format:  \ This file contains instructions in the following format:
 \   \ 
 \ forth name    stack effect    category        [pronounciation]  \ forth name    stack effect    category        [pronunciation]
 \ [""glossary entry""]  \ [""glossary entry""]
 \ C code  \ C code
 \ [:  \ [:
 \ Forth code]  \ Forth code]
 \   \ 
 \ The pronounciataion is also used for forming C names.  \ The pronunciation is also used for forming C names.
   \ 
   \ 
 \   \ 
 \ These informations are automagically translated into C-code for the  \ These informations are automatically translated into C-code for the
 \ interpreter and into some other files. The forth name of a word is  \ interpreter and into some other files. I hope that your C compiler has
 \ automatically turned into upper case. I hope that your C compiler has  
 \ decent optimization, otherwise the automatically generated code will  \ decent optimization, otherwise the automatically generated code will
 \ be somewhat slow. The Forth version of the code is included for manual  \ be somewhat slow. The Forth version of the code is included for manual
 \ compilers, so they will need to compile only the important words.  \ compilers, so they will need to compile only the important words.
Line 28 Line 31
 \ stack. Use different names on both sides of the '--', if you change a  \ stack. Use different names on both sides of the '--', if you change a
 \ value (some stores to the stack are optimized away).  \ value (some stores to the stack are optimized away).
 \   \ 
   \ 
   \ 
 \ The stack variables have the following types:  \ The stack variables have the following types:
   \ 
 \ name matches  type  \ name matches  type
 \ f.*           Bool  \ f.*           Bool
 \ c.*           Char  \ c.*           Char
Line 46 Line 52
 \ wid.*         WID  \ wid.*         WID
 \ f83name.*     F83Name *  \ f83name.*     F83Name *
 \   \ 
   \ 
   \ 
 \ In addition the following names can be used:  \ In addition the following names can be used:
 \ ip    the instruction pointer  \ ip    the instruction pointer
 \ sp    the data stack pointer  \ sp    the data stack pointer
 \ rp    the parameter stack pointer  \ rp    the parameter stack pointer
   \ lp    the locals stack pointer
 \ NEXT  executes NEXT  \ NEXT  executes NEXT
 \ cfa     \ cfa   
 \ NEXT1 executes NEXT1  \ NEXT1 executes NEXT1
 \ FLAG(x)       makes a Forth flag from a C flag  \ FLAG(x)       makes a Forth flag from a C flag
 \   \ 
   \ 
   \ 
 \ Percentages in comments are from Koopmans book: average/maximum use  \ Percentages in comments are from Koopmans book: average/maximum use
 \ (taken from four, not very representattive benchmarks)  \ (taken from four, not very representative benchmarks)
   \ 
   \ 
 \   \ 
 \ To do:  \ To do:
 \ make sensible error returns for file words  
 \   \ 
 \ throw execute, cfa and NEXT1 out?  \ throw execute, cfa and NEXT1 out?
 \ macroize *ip, ip++, *ip++ (pipelining)?  \ macroize *ip, ip++, *ip++ (pipelining)?
Line 737  c_addr2 = c_addr1 + 1; Line 749  c_addr2 = c_addr1 + 1;
 :  :
  1+ ;   1+ ;
   
 (chars)         n1 -- n2        core    cares  (chars) n1 -- n2                core    cares
 n2 = n1 * sizeof(Char);  n2 = n1 * sizeof(Char);
 :  :
  ;   ;
Line 1085  memmove(c_addr,sig,u); Line 1097  memmove(c_addr,sig,u);
 Float r;  Float r;
 char *number=cstr(c_addr, u, 1);  char *number=cstr(c_addr, u, 1);
 char *endconv;  char *endconv;
   while(isspace(number[u-1])) u--;
   switch(number[u-1])
   {
           case 'd':
           case 'D':
           case 'e':
           case 'E': u--; break;
           default: break;
   }
   number[u]='\0';
 r=strtod(number,&endconv);  r=strtod(number,&endconv);
 if((flag=FLAG(!(int)*endconv)))  if((flag=FLAG(!(int)*endconv)))
 {  {

Removed from v.1.22  
changed lines
  Added in v.1.23


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>