Example #1
0
        public Debugger(VM vm)
        {
            InitializeComponent();

            _vm = vm;

            _vm.cpu.RegisterDebuggingNotification(() =>
            {
                setSteppingControlsEnabled(true);
            });

            _vm.cpu.RegisterStepNotification(() =>
            {
                updateRegisterState(txtR0, Register.R0);
                updateRegisterState(txtR1, Register.R1);
                updateRegisterState(txtR2, Register.R2);
                updateRegisterState(txtR3, Register.R3);
                updateRegisterState(txtBP, Register.BP);
                updateRegisterState(txtIP, Register.IP);
                updateRegisterState(txtSP, Register.SP);
                updateCurrentInstruction();
                _memoryDisplayStartAddress = _vm.cpu.Registers[Register.IP];
                updateMemoryDisplay();
                updateStackDisplay();
            });
        }
Example #2
0
        private void Init()
        {
            this.Width = 800;
            this.Height = 600;

            _vm = new VM((int)Math.Pow(2, 29), @"C:\VM\bios.exe", @"C:\VM\VM.disk", this.CreateGraphics());

            this.SizeChanged += MainDisplay_SizeChanged;
            this.FormClosed += MainDisplay_FormClosed;
        }