add depth and unused

master
Ondřej Hruška 3 years ago
parent c02b3599fb
commit acfab363d3
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 12
      src/fh_builtins.c

@ -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 (#)

Loading…
Cancel
Save