--- gforth/prim 2009/01/29 19:51:28 1.239 +++ gforth/prim 2010/04/17 21:32:49 1.247 @@ -1,6 +1,6 @@ \ Gforth primitives -\ Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. +\ Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. \ This file is part of Gforth. @@ -233,6 +233,17 @@ SET_IP(DOES_CODE1(CFA)); ""just a slot to have an encoding for the DOESJUMP, which is no longer used anyway (!! eliminate this)"" +(doabicode) ( ... -- ...) gforth-internal paren_doabicode +""run-time routine for ABI-CODE definitions"" +abifunc *f = (abifunc *)PFA(CFA); +Float *fp_mem = fp; +sp = (*f)(sp, &fp_mem); +fp = fp_mem; +#ifdef NO_IP +INST_TAIL; +goto *next_code; +#endif /* defined(NO_IP) */ + \F [endif] \g control @@ -625,6 +636,12 @@ k ( R:w R:w1 R:w2 R:w3 R:w4 -- w R:w R:w \ digit is high-level: 0/0% +abi-call ( #a_callee ... -- ... ) gforth abi_call +abifunc *f = (abifunc *)a_callee; +Float *fp_mem = fp; +sp = (*f)(sp, &fp_mem); +fp = fp_mem; + \g strings move ( c_from c_to ucount -- ) core @@ -1836,13 +1853,15 @@ wior = IOR(ftruncate(fileno((FILE *)wfil read-file ( c_addr u1 wfileid -- u2 wior ) file read_file /* !! fread does not guarantee enough */ u2 = fread(c_addr, sizeof(Char), u1, (FILE *)wfileid); +if (u2>0) + gf_regetc((FILE *)wfileid); wior = FILEIO(u2