Esempio n. 1
0
        protected void HandleUSP(string[] tokens)
        {
            if (tokens is null)
            {
                throw new ArgumentNullException(nameof(tokens));
            }

            if (tokens.Length == 1)
            {
                writer.WriteLine("USP: {0}", cpu.GetUSP().ToString("x", CultureInfo.InvariantCulture));
            }
            else if (tokens.Length == 2)
            {
                int value;
                try
                {
                    value = ParseInt(tokens[1]);
                }
                catch (FormatException)
                {
                    writer.WriteLine($"Bad value [{tokens[1]}]");
                    return;
                }

                cpu.SetUSP(value);
            }
            else
            {
                writer.WriteLine($"usage: {tokens[0]} [value]");
            }
        }