part of multimodule execution impl in interpreter: separation of execution parts

This commit is contained in:
ProgramSnail 2024-11-29 23:43:35 +03:00
parent 59f3dfb43e
commit 009fdd6bfe
5 changed files with 78 additions and 38 deletions

View file

@ -2,4 +2,12 @@
#include "parser.h"
void run(uint mod_id, int argc, char **argv);
void run_init(size_t *stack);
void run_init_mod_rec(uint mod_id);
void run_prepare_exec(int argc, char **argv);
void run_mod(uint mod_id, int argc, char **argv);
void run_cleanup();

View file

@ -69,7 +69,9 @@ struct State {
char *call_ip; // prev instruction pointer (to remember jmp locations)
};
void construct_state(uint mod_id, struct State *s, void **stack);
void init_state(struct State *s, void **stack);
void init_mod_state(uint mod_id, struct State *s);
void init_mod_state_globals(struct State *s);
void cleanup_state(struct State *state);
// TODO: print current mod id