aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-01 16:15:21 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-01 16:15:21 +0100
commitc081dfe226c6e92865cbb97d8e9a2ef86d8c6acb (patch)
treec3761b67d705f370388d8e9758431f73ef0adf98
parent18a3b0c84c1d755546da27f0117e1ea09e2118de (diff)
downloadtr8vm-c081dfe226c6e92865cbb97d8e9a2ef86d8c6acb.tar.gz
tr8vm-c081dfe226c6e92865cbb97d8e9a2ef86d8c6acb.zip
Assign the value of the register
-rw-r--r--vm.c2
1 files changed, 1 insertions, 1 deletions
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)])];