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);