From: Lukas Krickl Date: Tue, 21 Nov 2023 10:41:56 +0000 (+0100) Subject: WIP: Added register definitions X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=304f5c327f7731d258cfb2d9c99ed847178b091c;p=ulas%2F.git WIP: Added register definitions --- diff --git a/include/ulas.h b/include/ulas.h index 21f15c8..1783a3f 100644 --- a/include/ulas.h +++ b/include/ulas.h @@ -298,6 +298,22 @@ enum ulas_asmdir { ULAS_ASMDIR_INCBIN, }; +enum ulas_asmregs { + // r8 + ULAS_REG_A = 7, + ULAS_REG_B = 0, + ULAS_REG_C = 1, + ULAS_REG_D = 2, + ULAS_REG_E = 3, + ULAS_REG_H = 4, + ULAS_REG_L = 5, + + // r16 + ULAS_REG_BC, + ULAS_REG_DE, + ULAS_REG_HL +}; + extern struct ulas_config ulascfg; struct ulas_config ulas_cfg_from_env(void); diff --git a/src/ulas.c b/src/ulas.c index 14164a3..38a1b49 100644 --- a/src/ulas.c +++ b/src/ulas.c @@ -1381,12 +1381,15 @@ int ulas_asminstr(char *dst, unsigned long max, const char *line, // TODO: check for symbol token here... if so add it // and skip to the next token + // misc / control ULAS_STATICINSTR("nop", 1, 0x00); ULAS_STATICINSTR("halt", 1, 0x76); ULAS_STATICINSTR("stop", 2, 0x10, 0x00); ULAS_STATICINSTR("di", 1, 0xF3); ULAS_STATICINSTR("ei", 1, 0xFB); + // 8 bit loads + ULASERR("Invalid instruction '%s'\n", ulas.tok.buf); return -1; }