version 1.54, 2000/12/13 10:15:26
|
version 1.56, 2000/12/26 19:24:18
|
Line 585 does> ( item -- )
|
Line 585 does> ( item -- )
|
stack stack-pointer 2@ type ." += " 0 .r ." ;" cr |
stack stack-pointer 2@ type ." += " 0 .r ." ;" cr |
endif ; |
endif ; |
|
|
|
: inst-pointer-update ( -- ) |
|
inst-stream stack-in @ ?dup-if |
|
." INC_IP(" 0 .r ." );" cr |
|
endif ; |
|
|
: stack-pointer-updates ( -- ) |
: stack-pointer-updates ( -- ) |
inst-stream stack-pointer-update |
inst-pointer-update |
data-stack stack-pointer-update |
data-stack stack-pointer-update |
fp-stack stack-pointer-update |
fp-stack stack-pointer-update |
return-stack stack-pointer-update ; |
return-stack stack-pointer-update ; |
Line 641 does> ( item -- )
|
Line 646 does> ( item -- )
|
cr |
cr |
; |
; |
|
|
|
: print-type-prefix ( type -- ) |
|
body> >head .name ; |
|
|
|
: disasm-arg { item -- } |
|
item item-stack @ inst-stream = if |
|
." printarg_" item item-type @ print-type-prefix |
|
." (ip[" item item-offset @ 1+ 0 .r ." ]);" cr |
|
endif ; |
|
|
|
: disasm-args ( -- ) |
|
effect-in-end @ effect-in ?do |
|
i disasm-arg |
|
item% %size +loop ; |
|
|
|
: output-disasm ( -- ) |
|
\ generate code for disassembling VM instructions |
|
." if (ip[0] == prim[" function-number @ 0 .r ." ]) {" cr |
|
." fputs(" [char] " emit forth-name 2@ type [char] " emit ." ,stdout);" cr |
|
." /* " declarations ." */" cr |
|
compute-offsets |
|
disasm-args |
|
." ip += " inst-stream stack-in @ 1+ 0 .r ." ;" cr |
|
." } else " |
|
1 function-number +! ; |
|
|
: stack-used? { stack -- f } |
: stack-used? { stack -- f } |
stack stack-in @ stack stack-out @ or 0<> ; |
stack stack-in @ stack stack-out @ or 0<> ; |
|
|