| |
|
| : flush-tos ( -- ) |
: flush-tos ( -- ) |
| effect-in-size 2@ effect-out-size 2@ |
effect-in-size 2@ effect-out-size 2@ |
| rot - swap rot - ( -f-diff -d-diff ) >r >r |
|
| effect-in-size 2@ effect-out-size 2@ |
|
| 0<> rot 0= and |
0<> rot 0= and |
| if |
if |
| ." IF_FTOS(fp[" r@ 0 .r ." ] = FTOS);" cr |
." IF_FTOS(fp[0] = FTOS);" cr |
| endif rdrop |
endif |
| 0<> swap 0= and |
0<> swap 0= and |
| if |
if |
| ." IF_TOS(sp[" r@ 0 .r ." ] = TOS);" cr |
." IF_TOS(sp[0] = TOS);" cr |
| endif rdrop ; |
endif ; |
| |
|
| : fill-tos ( -- ) |
: fill-tos ( -- ) |
| effect-in-size 2@ effect-out-size 2@ |
effect-in-size 2@ effect-out-size 2@ |
| : output-c ( -- ) |
: output-c ( -- ) |
| ." I_" c-name 2@ type ." : /* " forth-name 2@ type ." ( " stack-string 2@ type ." ) */" cr |
." I_" c-name 2@ type ." : /* " forth-name 2@ type ." ( " stack-string 2@ type ." ) */" cr |
| ." /* " doc 2@ type ." */" cr |
." /* " doc 2@ type ." */" cr |
| |
." NAME(" [char] " emit forth-name 2@ type [char] " emit ." )" cr \ debugging |
| ." {" cr |
." {" cr |
| ." DEF_CA" cr |
." DEF_CA" cr |
| declarations |
declarations |
| compute-offsets \ for everything else |
compute-offsets \ for everything else |
| |
." NEXT_P0;" cr |
| |
flush-tos |
| fetches |
fetches |
| stack-pointer-updates cr |
stack-pointer-updates |
| ." NAME(" [char] " emit forth-name 2@ type [char] " emit ." )" cr \ debugging |
|
| ." {" cr |
." {" cr |
| c-code 2@ type |
c-code 2@ type |
| ." }" cr |
." }" cr |
| ." NEXT_P1;" cr |
." NEXT_P1;" cr |
| flush-tos |
|
| stores |
stores |
| fill-tos |
fill-tos |
| ." NEXT_P2;" cr |
." NEXT_P2;" cr |