Interesting macros.
Value pop/push are only used to interactive between MB script and host, so you don't need to use mb_memdup or push anything for loading a script code.
Some idea might help:
mb_open/mb_close requires an 'mb_interpreter_t**' typed argument;
mb_load_string requires 'mb_interpreter_t*, const char*';
mb_run requires 'mb_interpreter_t*';
The main procedure should be somehow like:
mb_init
mb_open
mb_load_str("something...")
mb_run
mb_load_str("something else...")
mb_run
...
mb_close
mb_dispose
Where bas is a valid mb_interpreter_t*. A null 'bas' triggered the assertion.
I figured out you got many 'DIM AS struct mb_interpreter_t* bas = 0;' in every besFUNCTION in early posts, the latest post using a global 'bas' should be ok. Calling mb_init at the beginning is necessary, and check if there's any more problem.
BTW. It should be 'rtnval = mb_close(AT bas);' in besFUNCTION(mbas_close).