misc/kforth: Mostly finished with nucleus layer.

This commit is contained in:
2018-03-01 16:09:06 -08:00
parent adafdaa128
commit d96bf65a24
12 changed files with 587 additions and 52 deletions

View File

@@ -5,8 +5,24 @@
#include <stdint.h>
typedef int32_t KF_INT;
typedef uint32_t KF_UINT;
typedef int64_t KF_LONG;
constexpr size_t dshift = (sizeof(KF_INT) * 8) - 1;
constexpr uint8_t STACK_SIZE = 128;
typedef uintptr_t KF_ADDR;
constexpr uint8_t STACK_SIZE = 128;
constexpr size_t ARENA_SIZE = 65535;
static inline KF_INT
mask(size_t bits)
{
KF_INT m = 0;
for (size_t i = 0; i < bits; i++) {
m += 1 << i;
}
return m;
}
#endif