Diff for /gforth/code.fs between versions 1.21 and 1.23

version 1.21, 2010/04/17 21:31:36 version 1.23, 2010/12/31 18:09:02
Line 1 Line 1
 \ ASSEMBLER, CODE etc.  \ ASSEMBLER, CODE etc.
   
 \ Copyright (C) 1995,1996,1997,1999,2003,2007 Free Software Foundation, Inc.  \ Copyright (C) 1995,1996,1997,1999,2003,2007,2010 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 41  vocabulary assembler ( -- ) \ tools-ext Line 41  vocabulary assembler ( -- ) \ tools-ext
     defstart init-asm ;      defstart init-asm ;
   
 [ifdef] doabicode:  [ifdef] doabicode:
 : abi-code ( "name" -- colon-sys )      \ gforth        abi_code  : abi-code ( "name" -- colon-sys )      \ gforth        abi-code
    \G Start a native code definition that is called using the platform's     \G Start a native code definition that is called using the platform's
    \G ABI conventions corresponding to the C-prototype:     \G ABI conventions corresponding to the C-prototype:
    \G @example     \G @example
Line 69  vocabulary assembler ( -- ) \ tools-ext Line 69  vocabulary assembler ( -- ) \ tools-ext
 interpret/compile: ;code ( compilation. colon-sys1 -- colon-sys2 )      \ tools-ext     semicolon-code  interpret/compile: ;code ( compilation. colon-sys1 -- colon-sys2 )      \ tools-ext     semicolon-code
 \g The code after @code{;code} becomes the behaviour of the last  \g The code after @code{;code} becomes the behaviour of the last
 \g defined word (which must be a @code{create}d word).  The same  \g defined word (which must be a @code{create}d word).  The same
 \g caveats apply as for @code{code}, but Gforth does not have a  \g caveats apply as for @code{code}, so we recommend using
 \g @code{;abi-code} yet.  As a workaround, you can use @code{does> foo  \g @code{;abi-code} instead.
 \g ;} instead, where @code{foo} is defined with @code{abi-code}.  
   
   [ifdef] do;abicode: 
   : !;abi-code ( addr -- )
       latestxt do;abicode: any-code! ;
   
   : ;abi-code ( -- ) \ gforth semicolon-abi-code
       ['] !;abi-code does>-like postpone [ init-asm ; immediate
   [then]
       
 : end-code ( colon-sys -- )     \ gforth        end_code  : end-code ( colon-sys -- )     \ gforth        end_code
     \G End a code definition.  Note that you have to assemble the      \G End a code definition.  Note that you have to assemble the
     \G return from the ABI call (for @code{abi-code}) or the dispatch      \G return from the ABI call (for @code{abi-code}) or the dispatch
Line 80  interpret/compile: ;code ( compilation. Line 87  interpret/compile: ;code ( compilation.
     \G yourself.      \G yourself.
     latestxt here over - flush-icache      latestxt here over - flush-icache
     previous ?struc reveal ;      previous ?struc reveal ;
   

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


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