From 85241c04b9b58c2f58c8deeb975c2d05864c948d Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 24 Sep 2024 13:51:04 -0400 Subject: [PATCH] Fix lists --- dust-lang/src/vm.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dust-lang/src/vm.rs b/dust-lang/src/vm.rs index 2e067ce..8f5c573 100644 --- a/dust-lang/src/vm.rs +++ b/dust-lang/src/vm.rs @@ -101,9 +101,11 @@ impl Vm { } Operation::LoadList => { let to_register = instruction.destination(); - let length = instruction.first_argument(); - let first_register = to_register - length - 1; - let last_register = to_register - 1; + let first_register = instruction.first_argument(); + let length = instruction.second_argument(); + let last_register = first_register + length + 1; + + println!("{first_register}..={last_register}"); let mut list = Vec::with_capacity(length as usize);