Exemple #1
0
 /// <summary>
 /// Returns the virtual machine stac capacity.
 /// </summary>
 ///
 /// <returns>The stack capacity.</returns>
 public byte GetStackCapacity()
 {
     return(PInvoke.Sal8StackCapacity(ref stack));
 }
Exemple #2
0
 /// <summary>
 /// Returns the value of a stack slot.
 /// </summary>
 ///
 /// <param name="index">The slot index.</param>
 /// <returns>The value stored in the slot.</returns>
 public byte GetStackValue(byte index)
 {
     return(PInvoke.Sal8StackGet(ref stack, index));
 }
Exemple #3
0
 /// <summary>
 /// Returns the value of a register.
 /// </summary>
 ///
 /// <param name="index">The register index.</param>
 ///
 /// <returns>The value stored in the register.</returns>
 public byte GetRegisterValue(byte index)
 {
     return(PInvoke.Sal8VmAccessRegister(this, index));
 }
Exemple #4
0
 /// <summary>
 /// Returns the virtual machine stack size.
 /// </summary>
 ///
 /// <returns>The stack size.</returns>
 public byte GetStackSize()
 {
     return(PInvoke.Sal8StackSize(ref stack));
 }
Exemple #5
0
 /// <summary>
 /// Gets the total number of instructions from the loaded cluster.
 /// </summary>
 ///
 /// <returns>The total number of loaded instructions.</returns>
 public uint GetInstructionCount()
 {
     return(PInvoke.Sal8ClusterInstructionCount(ref cluster));
 }
Exemple #6
0
 public uint GetCurrentInstructionIndex()
 {
     return(PInvoke.Sal8VmCurrentInstructionIndex(this));
 }
Exemple #7
0
 /// <summary>
 /// Loads a cluster into the virtual machine.
 /// </summary>
 ///
 /// <param name="cluster">The cluster to load.</param>
 public void Load(Cluster cluster)
 {
     PInvoke.Sal8VmLoad(this, cluster);
 }
Exemple #8
0
 /// <summary>
 /// Whether or not the virtual machine finished executing all of the instructions from the cluster.
 /// </summary>
 ///
 /// <returns>True, if there is nothing left to execute. False otherwise.</returns>
 public bool Finished()
 {
     return(PInvoke.Sal8VmFinished(this) != 0);
 }
Exemple #9
0
 /// <summary>
 /// Redirects the STDERR stream to a handler.
 /// </summary>
 ///
 /// <param name="handler">The error handler.</param>
 public void RedirectErr(IO.OutHandler handler)
 {
     PInvoke.Sal8IoRedirectErr(ref io, handler);
 }
Exemple #10
0
 /// <summary>
 /// Redirects the STDIN stream to a handler. The handler should return either 0-255 for valid numbers, or >255 for errors/end-of-input.
 /// </summary>
 ///
 /// <param name="handler">The input handler.</param>
 public void RedirectIn(IO.InHandler handler)
 {
     PInvoke.Sal8IoRedirectIn(ref io, handler);
 }
Exemple #11
0
 /// <summary>
 /// Initializes a new instance of the VM class.
 /// </summary>
 ///
 /// <param name="registerCount">The total number of available registers.</param>
 /// <param name="stackCapacity">The stack capacity.</param>
 public VM(byte registerCount, byte stackCapacity)
 {
     PInvoke.Sal8VmInit(this, registerCount, stackCapacity);
 }
Exemple #12
0
 /// <summary>
 /// Initializes a new instance of the Compiler class.
 /// </summary>
 ///
 /// <param name="registerCount">The total number of available registers.</param>
 public Compiler(byte registerCount)
 {
     PInvoke.Sal8CompilerInit(this, registerCount);
 }
Exemple #13
0
 /// <summary>
 /// Destroys the cluster and frees any memory used by it.
 /// </summary>
 public void Destroy()
 {
     PInvoke.Sal8ClusterDelete(ref this);
 }