From 1dc13cc508307fe051e93a27a7b9d58f04f4bd22 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 25 Feb 2024 08:40:10 +0100 Subject: [PATCH] Fixed some instruction parsers for disas --- src/archs.h | 2 ++ src/uldas.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/archs.h b/src/archs.h index 98f100d..26e885a 100644 --- a/src/archs.h +++ b/src/archs.h @@ -1,6 +1,8 @@ #ifndef ARCHS_H_ #define ARCHS_H_ +#define ULAS_INSTRDATMAX_VAL 0xFFFF + enum ulas_endianess { ULAS_BE, ULAS_LE diff --git a/src/uldas.c b/src/uldas.c index c5b17c2..4ca3533 100644 --- a/src/uldas.c +++ b/src/uldas.c @@ -67,7 +67,7 @@ int ulas_dasm_instr_check(FILE *src, FILE *dst, const struct ulas_instr *instr, int bi = 0; // current buffer index // test all instruction's contents for (i = 0; instr->data[i]; i++) { - int dat = instr->data[i]; + unsigned int dat = instr->data[i] & ULAS_INSTRDATMAX_VAL; if (dat == ULAS_DATZERO) { dat = 0; } -- 2.30.2