diff --git a/src/SVM.Assembler/ISA.xml b/src/SVM.Assembler/ISA.xml index e4fdcc6..3bfd878 100644 --- a/src/SVM.Assembler/ISA.xml +++ b/src/SVM.Assembler/ISA.xml @@ -169,5 +169,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/SVM.Core/PrimaryInstruction.cs b/src/SVM.Core/PrimaryInstruction.cs index c718ccf..fb0aeee 100644 --- a/src/SVM.Core/PrimaryInstruction.cs +++ b/src/SVM.Core/PrimaryInstruction.cs @@ -36,6 +36,8 @@ // 0 1 2 3 // Load [R]Address [I]Len [R]T Load, + // 0 1 2 3 + // Load [R]Src [I]Len [R]TAddr Save, // 0 // Call diff --git a/src/SVM.Core/SimpleVirtualMachine.cs b/src/SVM.Core/SimpleVirtualMachine.cs index f470090..12a2f3f 100644 --- a/src/SVM.Core/SimpleVirtualMachine.cs +++ b/src/SVM.Core/SimpleVirtualMachine.cs @@ -182,6 +182,15 @@ namespace SVM.Core break; case PrimaryInstruction.Save: + { + var Reg = Instruction.GetData(1); + var Length = Instruction.GetData(2); + var Target = Instruction.GetData(3); + var tgtSVMPtr = registers.GetData(Target); + var tgtPtr = GetPointer(tgtSVMPtr); + var srcPtr = registers.GetPtr(Reg); + Buffer.MemoryCopy(srcPtr, (byte*)tgtPtr, Length, Length); + } break; case PrimaryInstruction.Call: break;