diff options
-rw-r--r-- | usr.bin/oasm/include/oasm/lex.h | 1 | ||||
-rw-r--r-- | usr.bin/oasm/label.c | 1 | ||||
-rw-r--r-- | usr.bin/oemu/cpu.c | 7 |
3 files changed, 9 insertions, 0 deletions
diff --git a/usr.bin/oasm/include/oasm/lex.h b/usr.bin/oasm/include/oasm/lex.h index fa82398..b392403 100644 --- a/usr.bin/oasm/include/oasm/lex.h +++ b/usr.bin/oasm/include/oasm/lex.h @@ -33,6 +33,7 @@ #include <sys/queue.h> #include <sys/cdefs.h> #include <stdint.h> +#include <stdbool.h> struct oasm_state; diff --git a/usr.bin/oasm/label.c b/usr.bin/oasm/label.c index c54209a..2647bb9 100644 --- a/usr.bin/oasm/label.c +++ b/usr.bin/oasm/label.c @@ -35,6 +35,7 @@ #include <stdlib.h> #include <string.h> #include <stddef.h> +#include <stdbool.h> static struct oasm_label *labels[MAX_LABELS]; static size_t label_count = 0; diff --git a/usr.bin/oemu/cpu.c b/usr.bin/oemu/cpu.c index 5a2c761..fefdd4c 100644 --- a/usr.bin/oemu/cpu.c +++ b/usr.bin/oemu/cpu.c @@ -408,6 +408,13 @@ cpu_kick(struct oemu_cpu *cpu, struct sysmem *mem) break; } + /* + * X0 is readonly and should always be zero, undo + * any writes or side effects from any operations + * upon this register. + */ + regs->xreg[0] = 0; + /* Is this a halt instruction? */ if (inst->opcode == INST_HLT) { printf("HALTED\n"); |