File:  [gforth] / gforth / code.fs
Revision 1.1: download - view: text, annotated - select for diffs
Sat Oct 7 17:42:14 1995 UTC (25 years, 11 months ago) by anton
Branches: MAIN
CVS tags: HEAD
added code.fs (for real)

    1: \ ASSEMBLER, CODE etc.
    2: 
    3: \ does not include the actual assembler (which is machine-dependent),
    4: \ only words like CODE that are implementation-dependent, but can be
    5: \ defined for all machines.
    6: 
    7: vocabulary assembler ( -- ) \ tools-ext
    8: 
    9: : init-asm ( -- )
   10:     also assembler ;
   11: 
   12: : code ( -- colon-sys )	\ tools-ext
   13:     \ start a native code definition
   14:     header here >body cfa, defstart init-asm ;
   15: 
   16: : (;code) ( -- ) \ gforth
   17:     \ execution semantics of @code{;code}
   18:     r> lastxt code-address! ;
   19: 
   20: : ;code ( colon-sys1 -- colon-sys2 )	\ tools-ext	semicolon-code
   21:     ( create the [;code] part of a low level defining word )
   22:     state @
   23:     IF
   24: 	;-hook postpone (;code) ?struc postpone [
   25:     ELSE
   26: 	align here lastxt code-address!
   27:     THEN
   28:     defstart init-asm ; immediate
   29: 
   30: : end-code ( colon-sys -- )	\ gforth	end_code
   31:     ( end a code definition )
   32:     lastxt here over - flush-icache
   33:     previous ?struc reveal ;

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