From c081dfe226c6e92865cbb97d8e9a2ef86d8c6acb Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 1 May 2023 16:15:21 +0100 Subject: Assign the value of the register --- vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm.c b/vm.c index 07d07ea..b9785ef 100644 --- a/vm.c +++ b/vm.c @@ -202,7 +202,7 @@ uint8_t tr8_eval(Tr8 *vm) case 2: if (FL(instr)) /* LD [r1:r2], r3 */ - vm->ram[ADDR(vm->regs[R1(instr)], vm->regs[R2(instr)])] = R3(instr); + vm->ram[ADDR(vm->regs[R1(instr)], vm->regs[R2(instr)])] = vm->regs[R3(instr)]; else /* LD r3, [r1:r2] */ vm->regs[R3(instr)] = vm->ram[ADDR(vm->regs[R1(instr)], vm->regs[R2(instr)])]; -- cgit v1.2.3