add depth and unused

This commit is contained in:
2021-11-15 00:31:07 +01:00
parent c02b3599fb
commit acfab363d3
+11 -1
View File
@@ -985,7 +985,15 @@ static enum fh_error w_depth(struct fh_thread_s *fh, const struct fh_word_s *w)
{
(void) w;
enum fh_error rv;
TRY(ds_push(fh, w->param));
TRY(ds_push(fh, fh->data_stack_top));
return FH_OK;
}
static enum fh_error w_unused(struct fh_thread_s *fh, const struct fh_word_s *w)
{
(void) w;
enum fh_error rv;
TRY(ds_push(fh, HEAP_SIZE - fh->heap_top));
return FH_OK;
}
@@ -1123,6 +1131,8 @@ enum fh_error register_builtin_words(struct fh_thread_s *fh)
{"aligned", w_aligned, 0, 0},
{"allot", w_allot, 0, 0},
{"align", w_align, 0, 0},
{"depth", w_depth, 0, 0},
{"unused", w_unused, 0, 0},
{",", w_comma, 0, 0},
// TODO +!
// TODO pictured numbers (#)