From 3e6c96d86451bfac4b28117b6d58c38d3300f64f Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Wed, 21 Feb 2024 17:18:54 +0100 Subject: [PATCH] WIP: Adding addr16 type --- src/archs.h | 1 + src/ulas.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/archs.h b/src/archs.h index d0f84ac..98f100d 100644 --- a/src/archs.h +++ b/src/archs.h @@ -60,6 +60,7 @@ enum ulas_asmspetok { // A8 is like E8, but it will not emit an overflow warning // because it is commont to pass a 16-bit label as a value ULAS_A8 = -3, + ULAS_A16 = -4, ULAS_DATZERO = 0xFF00 }; diff --git a/src/ulas.c b/src/ulas.c index 6852c8a..d6ac609 100644 --- a/src/ulas.c +++ b/src/ulas.c @@ -1823,7 +1823,8 @@ int ulas_asminstr(char *dst, unsigned long max, const char **line, if (strncmp(regstr, ulas.tok.buf, ulas.tok.maxlen) != 0) { goto skip; } - } else if (tok[i] == ULAS_E8 || tok[i] == ULAS_E16 || tok[i] == ULAS_A8) { + } else if (tok[i] == ULAS_E8 || tok[i] == ULAS_E16 || tok[i] == ULAS_A8 || + tok[i] == ULAS_A16) { assert(expridx < ULAS_INSTRDATMAX); int rc = 0; int res = ulas_intexpr(line, n, &rc); @@ -1867,7 +1868,7 @@ int ulas_asminstr(char *dst, unsigned long max, const char **line, if (dat[datread] == ULAS_E8 || dat[datread] == ULAS_A8) { dst[written] = (char)exprres[expridx++]; - } else if (dat[datread] == ULAS_E16) { + } else if (dat[datread] == ULAS_E16 || dat[datread] == ULAS_A16) { short val = (short)exprres[expridx++]; if (ulas.arch.endianess == ULAS_BE) { dst[written++] = (char)(val >> 8); -- 2.30.2