Пример #1
0
        private void UpdateDisplay()
        {
            int lines = lbMemory.Height / (lbMemory.Font.Height + 2);

            try
            {
                string nbr    = tbMemory.Text.ToUpper().Trim();
                int    digits = 10;
                int where = nbr.IndexOf('X');

                if (where >= 0)
                {
                    digits = 16;
                    nbr    = nbr.Substring(where + 1);
                }

                uint at = Convert.ToUInt32(nbr, digits);

                string[] newlines = new string[lines];

                for (int line = 0; line < lines; line++)
                {
                    string l = at.ToString("X").PadLeft(8, '0') + ':';
                    string d = string.Empty;
                    for (int x = 0; x < 16; x++)
                    {
                        byte mem = SimCPU.DirectRead8(at);

                        if (x % 4 == 0)
                        {
                            l = l + ' ';
                        }
                        l = l + mem.ToString("X").PadLeft(2, '0');
                        char b = (char)mem;
                        d = d + (char.IsLetterOrDigit(b) ? b : '.');
                        at++;
                    }

                    newlines[line] = l + ' ' + d;
                }
                lbMemory.Lines = newlines;
                Status         = string.Empty;
            }
            catch (Exception e)
            {
                Status = "Error: " + e.ToString();
            }
        }
Пример #2
0
 public override int ReadByte()
 {
     return((int)simCPU.DirectRead8(internaloffset + ((ulong)position++)));
 }
Пример #3
0
 byte IAssemblyCode.this[int index]
 {
     get { return(simCPU.DirectRead8((ulong)index + offset)); }
 }