| \ inline arguments (false) |
\ inline arguments (false) |
| include-skipped-insts off |
include-skipped-insts off |
| |
|
| |
variable immarg \ values for immediate arguments (to be used in IMM_ARG macros) |
| |
$12340000 immarg ! |
| |
|
| : th ( addr1 n -- addr2 ) |
: th ( addr1 n -- addr2 ) |
| cells + ; |
cells + ; |
| |
|
| : complement ( set1 -- set2 ) |
: complement ( set1 -- set2 ) |
| empty ['] bit-equivalent binary-set-operation ; |
empty ['] bit-equivalent binary-set-operation ; |
| |
|
| |
\ forward declaration for inst-stream (breaks cycle in definitions) |
| |
defer inst-stream-f ( -- stack ) |
| |
|
| \ stack access stuff |
\ stack access stuff |
| |
|
| : normal-stack-access ( n stack -- ) |
: normal-stack-access1 ( n stack -- ) |
| stack-pointer 2@ type |
stack-pointer 2@ type |
| dup |
dup |
| if |
if |
| drop ." TOS" |
drop ." TOS" |
| endif ; |
endif ; |
| |
|
| \ forward declaration for inst-stream (breaks cycle in definitions) |
: normal-stack-access ( n stack -- ) |
| defer inst-stream-f ( -- stack ) |
dup inst-stream-f = if |
| |
." IMM_ARG(" normal-stack-access1 ." ," immarg ? ." )" |
| |
1 immarg +! |
| |
else |
| |
normal-stack-access1 |
| |
endif ; |
| |
|
| : stack-depth { stack -- n } |
: stack-depth { stack -- n } |
| current-depth stack stack-number @ th @ ; |
current-depth stack stack-number @ th @ ; |
| 2drop ; |
2drop ; |
| |
|
| : output-label2 ( -- ) |
: output-label2 ( -- ) |
| ." LABEL2(" prim prim-c-name 2@ type ." )" cr ; |
." LABEL2(" prim prim-c-name 2@ type ." )" cr |
| |
." NEXT_P2;" cr ; |
| |
|
| : output-c-tail1 { xt -- } |
: output-c-tail1 { xt -- } |
| \ the final part of the generated C code, with xt printing LABEL2 or not. |
\ the final part of the generated C code, with xt printing LABEL2 or not. |
| ." NEXT_P1;" cr |
." NEXT_P1;" cr |
| stores |
stores |
| fill-tos |
fill-tos |
| xt execute |
xt execute ; |
| ." NEXT_P2;" cr ; |
|
| |
|
| : output-c-tail1-no-stores { xt -- } |
: output-c-tail1-no-stores { xt -- } |
| \ the final part of the generated C code for combinations |
\ the final part of the generated C code for combinations |
| output-super-end |
output-super-end |
| ." NEXT_P1;" cr |
." NEXT_P1;" cr |
| fill-tos |
fill-tos |
| xt execute |
xt execute ; |
| ." NEXT_P2;" cr ; |
|
| |
|
| : output-c-tail ( -- ) |
: output-c-tail ( -- ) |
| ['] noop output-c-tail1 ; |
['] noop output-c-tail1 ; |