using System; using System.Collections.Generic; using System.Text; using Sunweaver.Commands.Attributes; namespace Sunweaver.Commands.UnaryMath { [Punctuation] public class ExplicitStore : Commands.Label { public ExplicitStore(string name, int number) : base(name, number) { } public override void Implementation(Sunweaver.DataPrototypes.VirtualMachine VM) { if (VM.Stack.Count() == 0) return; int a = VM.Stack.Pop(); if (!VM.BoolStack.Peek()) return; int loc = Math.Abs(this.number) % 1000; VM.mem[loc] = (short)(a % 10000); } public override string ToString() { if (name != string.Empty) return "." + name; else return "." + number.ToString(); } } }