X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=interpreters%2Fbocfel%2Fstack.h;fp=interpreters%2Fbocfel%2Fstack.h;h=ab874137125e0132d7bc2dfc5fa9c5c08d47301f;hb=3c59ba5eef5cb4d39c06eb7f523b9c3b026bdc9b;hp=0000000000000000000000000000000000000000;hpb=ed91d840318ed6ebfe3a5a77fa17114ddbf56640;p=projects%2Fchimara%2Fchimara.git diff --git a/interpreters/bocfel/stack.h b/interpreters/bocfel/stack.h new file mode 100644 index 0000000..ab87413 --- /dev/null +++ b/interpreters/bocfel/stack.h @@ -0,0 +1,63 @@ +#ifndef ZTERP_STACK_H +#define ZTERP_STACK_H + +#include + +#include "io.h" + +#define DEFAULT_STACK_SIZE 0x4000 +#define DEFAULT_CALL_DEPTH 0x400 + +void init_stack(void); + +uint16_t variable(uint16_t); +void store_variable(uint16_t, uint16_t); +uint16_t *stack_top_element(void); + +void call(int); +#ifdef ZTERP_GLK +uint16_t direct_call(uint16_t); +#endif +void do_return(uint16_t); + +int save_quetzal(zterp_io *, int); +int restore_quetzal(zterp_io *, int); + +int do_save(int); +int do_restore(int); + +int push_save(void); +int pop_save(void); + +void zpush(void); +void zpull(void); +void zload(void); +void zstore(void); +void zret_popped(void); +void zpop(void); +void zcatch(void); +void zthrow(void); +void zret(void); +void zrtrue(void); +void zrfalse(void); +void zcheck_arg_count(void); +void zpop_stack(void); +void zpush_stack(void); +void zsave_undo(void); +void zrestore_undo(void); +void zsave(void); +void zrestore(void); + +void zcall_store(void); +void zcall_nostore(void); + +#define zcall zcall_store +#define zcall_1n zcall_nostore +#define zcall_1s zcall_store +#define zcall_2n zcall_nostore +#define zcall_2s zcall_store +#define zcall_vn zcall_nostore +#define zcall_vn2 zcall_nostore +#define zcall_vs2 zcall_store + +#endif