| endif |
endif |
| 2drop ; |
2drop ; |
| |
|
| : output-c-tail ( -- ) |
: output-c-tail1 ( -- ) |
| \ the final part of the generated C code |
\ the final part of the generated C code except LABEL2 and NEXT_P2 |
| output-super-end |
output-super-end |
| print-debug-results |
print-debug-results |
| ." NEXT_P1;" cr |
." NEXT_P1;" cr |
| stores |
stores |
| fill-tos |
fill-tos ; |
| |
|
| |
: output-c-tail ( -- ) |
| |
\ the final part of the generated C code, without LABEL2 |
| |
output-c-tail1 |
| ." NEXT_P2;" ; |
." NEXT_P2;" ; |
| |
|
| |
: output-c-tail2 ( -- ) |
| |
\ the final part of the generated C code, including LABEL2 |
| |
output-c-tail1 |
| |
." 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 "TAIL;" with tail code produced by xt |
\ like TYPE, but replaces "TAIL;" with tail code produced by xt |
| { xt } |
{ xt } |
| ." #line " c-line @ . quote c-filename 2@ type quote cr |
." #line " c-line @ . quote c-filename 2@ type quote cr |
| prim prim-c-code 2@ ['] output-c-tail type-c-code |
prim prim-c-code 2@ ['] output-c-tail type-c-code |
| ." }" cr |
." }" cr |
| output-c-tail |
output-c-tail2 |
| ." }" cr |
." }" cr |
| cr |
cr |
| ; |
; |
| |
|
| : disasm-arg { item -- } |
: disasm-arg { item -- } |
| item item-stack @ inst-stream = if |
item item-stack @ inst-stream = if |
| ." fputc(' ', vm_out); " |
." {" cr |
| \ !! change this to first convert args to the right type and |
item print-declaration |
| \ then print them |
item fetch |
| ." /* printarg_" item item-type @ print-type-prefix |
item print-debug-arg |
| ." ((" item item-type @ type-c-name 2@ type ." )" |
." }" cr |
| ." ip[" item item-offset @ 1+ 0 .r ." ]); */" cr |
|
| endif ; |
endif ; |
| |
|
| : disasm-args ( -- ) |
: disasm-args ( -- ) |
| \ #line 516 "./prim" |
\ #line 516 "./prim" |
| \ n = n1+n2; |
\ n = n1+n2; |
| \ } |
\ } |
| \ NEXT_P1; |
|
| \ _x_sp0 = (Cell)n; |
\ _x_sp0 = (Cell)n; |
| \ NEXT_P2; |
|
| \ } |
\ } |
| \ NEXT_P1; |
\ NEXT_P1; |
| \ spTOS = (Cell)_x_sp0; |
\ spTOS = (Cell)_x_sp0; |
| \ print-debug-args |
\ print-debug-args |
| stack-pointer-updates |
stack-pointer-updates |
| output-parts |
output-parts |
| output-c-tail |
output-c-tail2 |
| ." }" cr |
." }" cr |
| cr ; |
cr ; |
| |
|