Replaced XV with Z to make things uniform + fixed remaining non-valid asm.js.

This commit is contained in:
Brad Nelson
2022-07-12 18:13:56 -07:00
parent cd9228a609
commit 9d874a08fb
9 changed files with 67 additions and 55 deletions

View File

@ -17,22 +17,22 @@
#define ADDROF(x) ((void *) OP_ ## x)
enum {
#define XV(flags, name, op, code) OP_ ## op,
#define Z(flags, name, op, code) OP_ ## op,
PLATFORM_OPCODE_LIST
EXTRA_OPCODE_LIST
OPCODE_LIST
#undef XV
#undef Z
};
static cell_t *forth_run(cell_t *init_rp) {
static const BUILTIN_WORD builtins[] = {
#define XV(flags, name, op, code) \
#define Z(flags, name, op, code) \
name, ((VOC_ ## flags >> 8) & 0xff) | BUILTIN_MARK, sizeof(name) - 1, \
(VOC_ ## flags & 0xff), (void *) OP_ ## op,
PLATFORM_OPCODE_LIST
EXTRA_OPCODE_LIST
OPCODE_LIST
#undef XV
#undef Z
0, 0, 0,
};
@ -49,11 +49,11 @@ next:
w = *ip++;
work:
switch (*(cell_t *) w & 0xff) {
#define XV(flags, name, op, code) case OP_ ## op: { code; } NEXT;
#define Z(flags, name, op, code) case OP_ ## op: { code; } NEXT;
PLATFORM_OPCODE_LIST
EXTRA_OPCODE_LIST
OPCODE_LIST
#undef XV
#undef Z
}
}
}