version 1.119, 2002/10/12 18:36:25
|
version 1.120, 2002/10/12 19:06:37
|
Line 657 stack inst-stream IP Cell
|
Line 657 stack inst-stream IP Cell
|
: fetches ( -- ) |
: fetches ( -- ) |
prim prim-effect-in prim prim-effect-in-end @ ['] fetch map-items ; |
prim prim-effect-in prim prim-effect-in-end @ ['] fetch map-items ; |
|
|
: inst-pointer-update ( -- ) |
|
inst-stream stack-in @ ?dup-if |
|
." INC_IP(" 0 .r ." );" cr |
|
endif ; |
|
|
|
: stack-pointer-update { stack -- } |
: stack-pointer-update { stack -- } |
\ stack grow downwards |
\ stack grow downwards |
stack stack-diff |
stack stack-diff |
?dup-if \ this check is not necessary, gcc would do this for us |
?dup-if \ this check is not necessary, gcc would do this for us |
stack inst-stream = if |
stack inst-stream = if |
inst-pointer-update |
." INC_IP(" 0 .r ." );" cr |
else |
else |
stack stack-pointer 2@ type ." += " 0 .r ." ;" cr |
stack stack-pointer 2@ type ." += " 0 .r ." ;" cr |
endif |
endif |
Line 718 stack inst-stream IP Cell
|
Line 713 stack inst-stream IP Cell
|
endif |
endif |
2drop ; |
2drop ; |
|
|
: output-c-tail1 ( -- ) |
: output-label2 ( -- ) |
\ the final part of the generated C code before stores |
." LABEL2(" prim prim-c-name 2@ type ." )" cr ; |
|
|
|
: output-c-tail1 { xt -- } |
|
\ the final part of the generated C code, with xt printing LABEL2 or not. |
output-super-end |
output-super-end |
print-debug-results |
print-debug-results |
." NEXT_P1;" cr ; |
." NEXT_P1;" cr |
|
|
: output-c-tail ( -- ) |
|
\ the final part of the generated C code, without LABEL2 |
|
output-c-tail1 |
|
stores |
stores |
fill-tos |
fill-tos |
." NEXT_P2;" ; |
xt execute |
|
." NEXT_P2;" cr ; |
|
|
: output-c-tail-no-stores ( -- ) |
: output-c-tail1-no-stores { xt -- } |
\ the final part of the generated C code, without LABEL2 |
\ the final part of the generated C code for combinations |
output-c-tail1 |
output-super-end |
|
." NEXT_P1;" cr |
fill-tos |
fill-tos |
." NEXT_P2;" ; |
xt execute |
|
." NEXT_P2;" cr ; |
|
|
|
: output-c-tail ( -- ) |
|
['] noop output-c-tail1 ; |
|
|
: output-c-tail2 ( -- ) |
: output-c-tail2 ( -- ) |
\ the final part of the generated C code, including LABEL2 |
['] output-label2 output-c-tail1 ; |
output-c-tail1 |
|
stores |
: output-c-tail-no-stores ( -- ) |
fill-tos |
['] noop output-c-tail1-no-stores ; |
." LABEL2(" prim prim-c-name 2@ type ." )" cr |
|
." NEXT_P2;" cr ; |
|
|
|
: output-c-tail2-no-stores ( -- ) |
: output-c-tail2-no-stores ( -- ) |
\ the final part of the generated C code, including LABEL2 |
['] output-label2 output-c-tail1-no-stores ; |
output-c-tail1 |
|
fill-tos |
|
." LABEL2(" prim prim-c-name 2@ type ." )" cr |
|
." NEXT_P2;" cr ; |
|
|
|
: type-c-code ( c-addr u xt -- ) |
: type-c-code ( c-addr u xt -- ) |
\ like TYPE, but replaces "INST_TAIL;" with tail code produced by xt |
\ like TYPE, but replaces "INST_TAIL;" with tail code produced by xt |