| i xt execute |
i xt execute |
| item% %size +loop ; |
item% %size +loop ; |
| |
|
| |
\ types |
| |
|
| |
: print-type-prefix ( type -- ) |
| |
body> >head name>string type ; |
| |
|
| \ various variables for storing stuff of one primitive |
\ various variables for storing stuff of one primitive |
| |
|
| struct% |
struct% |
| \ fetch a single stack item from its stack |
\ fetch a single stack item from its stack |
| >r |
>r |
| r@ item-name 2@ type |
r@ item-name 2@ type |
| ." = (" |
." = vm_" r@ item-stack @ stack-type @ type-c-name 2@ type |
| r@ item-type @ type-c-name 2@ type ." ) " |
." 2" r@ item-type @ print-type-prefix ." (" |
| r@ item-in-index r@ item-stack @ stack-access |
r@ item-in-index r@ item-stack @ stack-access |
| ." ;" cr |
." );" cr |
| rdrop ; |
rdrop ; |
| |
|
| : fetch-double ( item -- ) |
: fetch-double ( item -- ) |
| |
|
| : really-store-single ( item -- ) |
: really-store-single ( item -- ) |
| >r |
>r |
| r@ item-out-index r@ item-stack @ stack-access ." = " |
r@ item-out-index r@ item-stack @ stack-access ." = vm_" |
| r@ item-stack @ stack-cast 2@ type |
r@ item-type @ print-type-prefix ." 2" |
| r@ item-name 2@ type ." ;" |
r@ item-stack @ stack-type @ type-c-name 2@ type ." (" |
| |
r@ item-name 2@ type ." );" |
| rdrop ; |
rdrop ; |
| |
|
| : store-single ( item -- ) |
: store-single ( item -- ) |
| s" Float" single 0 create-type float-type |
s" Float" single 0 create-type float-type |
| |
|
| s" sp" save-mem cell-type s" (Cell)" make-stack data-stack |
s" sp" save-mem cell-type s" (Cell)" make-stack data-stack |
| s" fp" save-mem cell-type s" " make-stack fp-stack |
s" fp" save-mem float-type s" " make-stack fp-stack |
| s" rp" save-mem float-type s" (Cell)" make-stack return-stack |
s" rp" save-mem cell-type s" (Cell)" make-stack return-stack |
| s" IP" save-mem cell-type s" error don't use # on results" make-stack inst-stream |
s" IP" save-mem cell-type s" error don't use # on results" make-stack inst-stream |
| ' inst-in-index inst-stream stack-in-index-xt ! |
' inst-in-index inst-stream stack-in-index-xt ! |
| \ !! initialize stack-in and stack-out |
\ !! initialize stack-in and stack-out |
| repeat |
repeat |
| 2drop type ; |
2drop type ; |
| |
|
| : print-type-prefix ( type -- ) |
|
| body> >head .name ; |
|
| |
|
| : print-debug-arg { item -- } |
: print-debug-arg { item -- } |
| ." fputs(" quote space item item-name 2@ type ." =" quote ." , vm_out); " |
." fputs(" quote space item item-name 2@ type ." =" quote ." , vm_out); " |
| ." printarg_" item item-type @ print-type-prefix |
." printarg_" item item-type @ print-type-prefix |