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, 6 months ago) by anton
Branches: MAIN
CVS tags: HEAD
added code.fs (for real)

\ ASSEMBLER, CODE etc.

\ does not include the actual assembler (which is machine-dependent),
\ only words like CODE that are implementation-dependent, but can be
\ defined for all machines.

vocabulary assembler ( -- ) \ tools-ext

: init-asm ( -- )
    also assembler ;

: code ( -- colon-sys )	\ tools-ext
    \ start a native code definition
    header here >body cfa, defstart init-asm ;

: (;code) ( -- ) \ gforth
    \ execution semantics of @code{;code}
    r> lastxt code-address! ;

: ;code ( colon-sys1 -- colon-sys2 )	\ tools-ext	semicolon-code
    ( create the [;code] part of a low level defining word )
    state @
    IF
	;-hook postpone (;code) ?struc postpone [
    ELSE
	align here lastxt code-address!
    THEN
    defstart init-asm ; immediate

: end-code ( colon-sys -- )	\ gforth	end_code
    ( end a code definition )
    lastxt here over - flush-icache
    previous ?struc reveal ;

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