aboutsummaryrefslogtreecommitdiffstats
path: root/creole.h
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2023-02-11 14:28:43 +0000
committerGravatar Peter McGoron 2023-02-11 14:28:43 +0000
commit582a0a2c9a476abe9dec3410ff4f555433ed9e0f (patch)
tree422878d94f091f440143348d7f52fcfa42b294dc /creole.h
parenttest pop (diff)
enable compiling and add compile test
Diffstat (limited to '')
-rw-r--r--creole.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/creole.h b/creole.h
index 827fe82..cb43e8b 100644
--- a/creole.h
+++ b/creole.h
@@ -47,6 +47,18 @@ enum creole_compiler_ret {
CREOLE_COMPILE_RET_LEN
};
+enum creole_run_ret {
+ CREOLE_STEP_CONTINUE,
+ CREOLE_STEP_SYSCALL,
+ CREOLE_STEP_STOP,
+ CREOLE_STACK_OVERFLOW,
+ CREOLE_STACK_UNDERFLOW,
+ CREOLE_RUN_LABEL_OVERFLOW,
+ CREOLE_REGISTER_OVERFLOW,
+ CREOLE_STEP_UNKNOWN_OPCODE,
+ CREOLE_RUN_RET_LEN
+};
+
struct creole_ins {
enum creole_opcode opcode;
unsigned char w_flags[3];
@@ -79,4 +91,12 @@ creole_parse_line(struct creole_ins *ins, struct creole_reader *r);
enum creole_compiler_ret
creole_compile(struct creole_env *env, struct creole_reader *r);
+enum creole_run_ret creole_reg_write(struct creole_env *env, creole_word w,
+ unsigned reg);
+enum creole_run_ret creole_reg_read(struct creole_env *env, creole_word *w,
+ unsigned reg);
+enum creole_run_ret creole_push(struct creole_env *env, creole_word w);
+enum creole_run_ret creole_pop(struct creole_env *env, creole_word *w);
+enum creole_run_ret creole_step(struct creole_env *env, creole_word *sc);
+
#endif /* CREOLE_H */