| \ 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). |
| \ |
\ |
| |
\ For superinstructions the syntax is: |
| |
\ |
| |
\ forth-name [/ c-name] = forth-name forth-name ... |
| \ |
\ |
| \ |
\ |
| \ The stack variables have the following types: |
\ The stack variables have the following types: |
| code-address! ( c_addr xt -- ) gforth code_address_store |
code-address! ( c_addr xt -- ) gforth code_address_store |
| ""Create a code field with code address @i{c-addr} at @i{xt}."" |
""Create a code field with code address @i{c-addr} at @i{xt}."" |
| MAKE_CF(xt, c_addr); |
MAKE_CF(xt, c_addr); |
| CACHE_FLUSH(xt,(size_t)PFA(0)); |
|
| : |
: |
| ! ; |
! ; |
| |
|
| ""Create a code field at @i{xt} for a child of a @code{DOES>}-word; |
""Create a code field at @i{xt} for a child of a @code{DOES>}-word; |
| @i{a-addr} is the start of the Forth code after @code{DOES>}."" |
@i{a-addr} is the start of the Forth code after @code{DOES>}."" |
| MAKE_DOES_CF(xt, a_addr); |
MAKE_DOES_CF(xt, a_addr); |
| CACHE_FLUSH(xt,(size_t)PFA(0)); |
|
| : |
: |
| dodoes: over ! cell+ ! ; |
dodoes: over ! cell+ ! ; |
| |
|
| ""Create a @code{DOES>}-handler at address @i{a-addr}. Normally, |
""Create a @code{DOES>}-handler at address @i{a-addr}. Normally, |
| @i{a-addr} points just behind a @code{DOES>}."" |
@i{a-addr} points just behind a @code{DOES>}."" |
| MAKE_DOES_HANDLER(a_addr); |
MAKE_DOES_HANDLER(a_addr); |
| CACHE_FLUSH((caddr_t)a_addr,DOES_HANDLER_SIZE); |
|
| : |
: |
| drop ; |
drop ; |
| |
|
| compile-prim ( xt1 -- xt2 ) new compile_prim |
compile-prim ( xt1 -- xt2 ) new compile_prim |
| xt2 = (Xt)compile_prim((Label)xt1); |
xt2 = (Xt)compile_prim((Label)xt1); |
| |
|
| lit@ ( #a_addr -- w ) new lit_fetch |
lit@ / lit_fetch = lit @ |
| w = *a_addr; |
|
| |
|
| lit-perform ( #a_addr -- ) new lit_perform |
lit-perform ( #a_addr -- ) new lit_perform |
| ip=IP; |
ip=IP; |
| SUPER_END; |
SUPER_END; |
| EXEC(*(Xt *)a_addr); |
EXEC(*(Xt *)a_addr); |
| |
|
| lit+ ( #n1 n2 -- n3 ) new lit_plus |
lit+ / lit_plus = lit + |
| n3 = n1 + n2; |
|
| |
|
| does-exec ( #a_cfa -- R:nest a_pfa ) new does_exec |
does-exec ( #a_cfa -- R:nest a_pfa ) new does_exec |
| a_pfa = PFA(a_cfa); |
a_pfa = PFA(a_cfa); |