using System; using System.Collections.Generic; using System.Text; using Sunweaver.Commands.Attributes; namespace Sunweaver.Commands { [Punctuation("Push the memory value of the given memory location to the integer stack.")] public class ExplicitRef : Commands.Label { public ExplicitRef(string name, Int16 number) : base(name, number) { } public override void Implementation(Sunweaver.VM.VirtualMachine VM) { VM.Stack.Push(VM.Memory[number % (Sunweaver.VM.Memory.MemorySlots+1)]); } public override string ToString() { if (Name != string.Empty) return "*" + Name; else return "*" + number.ToString(); } } }