From cfc9edebbadd0b079567058d5d78ba218f94be2b Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 15 Oct 2023 04:57:38 +0100 Subject: Added macro constructors for union types --- src/main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/main.c b/src/main.c index 171a0a1..2c5ee64 100644 --- a/src/main.c +++ b/src/main.c @@ -41,6 +41,9 @@ typedef union word as_word; } data_t; +#define DBYTE(BYTE) ((data_t){.as_byte = (BYTE)}) +#define DWORD(WORD) ((data_t){.as_word = (WORD)}) + void vm_push_byte(vm_t *vm, data_t b) { if (vm->stack.pointer >= VM_STACK_MAX) -- cgit v1.2.3-13-gbd6f