aboutsummaryrefslogtreecommitdiff
path: root/src/fvm.c
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2024-12-07 22:54:12 +0800
committerMistivia <i@mistivia.com>2024-12-07 22:54:12 +0800
commit3e6bf6091cc32cf11d61c0250bde9115208ad5d5 (patch)
treed451ea9afa53610fd98b574676b53d932994d130 /src/fvm.c
parent22b08dbf32e9c5de1f10c19897422168100fa639 (diff)
simplify asm language
Diffstat (limited to 'src/fvm.c')
-rw-r--r--src/fvm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fvm.c b/src/fvm.c
index 3a5a4e2..1384e92 100644
--- a/src/fvm.c
+++ b/src/fvm.c
@@ -340,8 +340,12 @@ int64_t fvm_execute(struct fvm *vm) {
a = fvm_pop(vm);
fvm_push(vm, vm->pc + 1);
vm->pc = a;
+ fvm_push(vm, vm->bp);
+ vm->bp = vm->sp;
break;
case FVM_OP_RET:
+ vm->sp = vm->bp;
+ vm->bp = fvm_pop(vm);
a = fvm_pop(vm);
vm->pc = a;
break;