| 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 |
| 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 yourself. |
\G yourself. |
| latestxt here over - flush-icache |
latestxt here over - flush-icache |
| previous ?struc reveal ; |
previous ?struc reveal ; |
| |
|