Esempio n. 1
0
        private void change(rejestr rej, bool ktory, int wart)
        {
            if (ktory)
            {
                string binary = Convert.ToString(wart, 2);
                int    x      = 8 - binary.Length;
                for (int i = 0; i < x; i++)
                {
                    binary = "0" + binary;
                }

                for (int i = 0; i < 8; i++)
                {
                    rej.tab_h[7 - i].Text = binary.Substring(i, 1);
                }
            }
            else
            {
                string binary = Convert.ToString(wart, 2);
                int    x      = 8 - binary.Length;
                for (int i = 0; i < x; i++)
                {
                    binary = "0" + binary;
                }

                for (int i = 0; i < 8; i++)
                {
                    rej.tab_l[7 - i].Text = binary.Substring(i, 1);
                }
            }
        }
Esempio n. 2
0
        public Form1()
        {
            InitializeComponent();
            ax    = new rejestr();
            bx    = new rejestr();
            cx    = new rejestr();
            dx    = new rejestr();
            stala = new rejestr();

            ahButtons = new Button[8]; alButtons = new Button[8];
            bhButtons = new Button[8]; blButtons = new Button[8];
            chButtons = new Button[8]; clButtons = new Button[8];
            dhButtons = new Button[8]; dlButtons = new Button[8];

            ahButtons[0] = ah0; ahButtons[1] = ah1; ahButtons[2] = ah2; ahButtons[3] = ah3;
            ahButtons[4] = ah4; ahButtons[5] = ah5; ahButtons[6] = ah6; ahButtons[7] = ah7;

            alButtons[0] = al0; alButtons[1] = al1; alButtons[2] = al2; alButtons[3] = al3;
            alButtons[4] = al4; alButtons[5] = al5; alButtons[6] = al6; alButtons[7] = al7;

            bhButtons[0] = bh0; bhButtons[1] = bh1; bhButtons[2] = bh2; bhButtons[3] = bh3;
            bhButtons[4] = bh4; bhButtons[5] = bh5; bhButtons[6] = bh6; bhButtons[7] = bh7;

            blButtons[0] = bl0; blButtons[1] = bl1; blButtons[2] = bl2; blButtons[3] = bl3;
            blButtons[4] = bl4; blButtons[5] = bl5; blButtons[6] = bl6; blButtons[7] = bl7;

            chButtons[0] = ch0; chButtons[1] = ch1; chButtons[2] = ch2; chButtons[3] = ch3;
            chButtons[4] = ch4; chButtons[5] = ch5; chButtons[6] = ch6; chButtons[7] = ch7;

            clButtons[0] = cl0; clButtons[1] = cl1; clButtons[2] = cl2; clButtons[3] = cl3;
            clButtons[4] = cl4; clButtons[5] = cl5; clButtons[6] = cl6; clButtons[7] = cl7;

            dhButtons[0] = dh0; dhButtons[1] = dh1; dhButtons[2] = dh2; dhButtons[3] = dh3;
            dhButtons[4] = dh4; dhButtons[5] = dh5; dhButtons[6] = dh6; dhButtons[7] = dh7;

            dlButtons[0] = dl0; dlButtons[1] = dl1; dlButtons[2] = dl2; dlButtons[3] = dl3;
            dlButtons[4] = dl4; dlButtons[5] = dl5; dlButtons[6] = dl6; dlButtons[7] = dl7;

            ax.tabH = ahButtons; ax.tabL = alButtons;
            bx.tabH = bhButtons; bx.tabL = blButtons;
            cx.tabH = chButtons; cx.tabL = clButtons;
            dx.tabH = dhButtons; dx.tabL = dlButtons;

            ax.hLabel = AH_label; ax.lLabel = AL_label;
            bx.hLabel = BH_label; bx.lLabel = BL_label;
            cx.hLabel = CH_label; cx.lLabel = CL_label;
            dx.hLabel = DH_label; dx.lLabel = DL_label;

            ax.hLabelHex = AH_labelHex; ax.lLabelHex = AL_labelHex;
            bx.hLabelHex = BH_labelHex; bx.lLabelHex = BL_labelHex;
            cx.hLabelHex = CH_labelHex; cx.lLabelHex = CL_labelHex;
            dx.hLabelHex = DH_labelHex; dx.lLabelHex = DL_labelHex;
        }
Esempio n. 3
0
        //ustawienie nowych bitow w buttonach, po wykonaniu rozkazu
        private void ustawBityILabelki(rejestr rej, bool low1)
        {
            string wartoscBinarna = "";
            int    dlugosc;

            if (low1 == true)
            {
                wartoscBinarna = Convert.ToString(rej.l, 2);
                dlugosc        = 8 - wartoscBinarna.Length;
                //dopelniamy zerami jesli string jest za krotki (mniejszy od 8 znakow)
                for (int i = 0; i < dlugosc; i++)
                {
                    wartoscBinarna = "0" + wartoscBinarna;
                }
                //przepisujemy do buttona
                for (int i = 0; i < 8; i++)
                {
                    rej.tabL[7 - i].Text = wartoscBinarna.Substring(i, 1);
                }
                rej.lLabel.Text    = rej.l.ToString();
                rej.lLabelHex.Text = Convert.ToString(rej.l, 16) + "h";
            }
            else
            {
                wartoscBinarna = Convert.ToString(rej.h, 2);
                dlugosc        = 8 - wartoscBinarna.Length;
                //dopelniamy zerami jesli string jest za krotki (mniejszy od 8 znakow)
                for (int i = 0; i < dlugosc; i++)
                {
                    wartoscBinarna = "0" + wartoscBinarna;
                }
                //przepisujemy do buttona
                for (int i = 0; i < 8; i++)
                {
                    rej.tabH[7 - i].Text = wartoscBinarna.Substring(i, 1);
                }
                rej.hLabel.Text    = rej.h.ToString();
                rej.hLabelHex.Text = Convert.ToString(rej.h, 16) + "h";
            }
            textBox_SP.Text = stos.Get_SP();
        }
Esempio n. 4
0
        //ustawienie nowych bitow w buttonach, po wykonaniu rozkazu
        private void ustawBity(rejestr rej1, bool low1)
        {
            string wartoscBinarna = "";
            int    dlugosc;

            if (low1 == true)
            {
                wartoscBinarna = Convert.ToString(rej1.l, 2);
                dlugosc        = 8 - wartoscBinarna.Length;
                //dopelniamy zerami jesli string jest za krotki (mniejszy od 8 znakow)
                for (int i = 0; i < dlugosc; i++)
                {
                    wartoscBinarna = "0" + wartoscBinarna;
                }
                //przepisujemy do buttona
                for (int i = 0; i < 8; i++)
                {
                    rej1.tabL[7 - i].Text = wartoscBinarna.Substring(i, 1);
                }
            }
            else
            {
                wartoscBinarna = Convert.ToString(rej1.h, 2);
                dlugosc        = 8 - wartoscBinarna.Length;
                //dopelniamy zerami jesli string jest za krotki (mniejszy od 8 znakow)
                for (int i = 0; i < dlugosc; i++)
                {
                    wartoscBinarna = "0" + wartoscBinarna;
                }
                //przepisujemy do buttona
                for (int i = 0; i < 8; i++)
                {
                    rej1.tabH[7 - i].Text = wartoscBinarna.Substring(i, 1);
                }
            }
        }
Esempio n. 5
0
        private void wyk_kom(int pol, int wartosc, rejestr rej, bool ktory)
        {
            if (pol == 1)
            {
                if (ktory)
                {
                    rej.dec_h.Text = wartosc.ToString();
                    rej.hex_h.Text = "0x" + wartosc.ToString("X");
                }
                else
                {
                    rej.dec_l.Text = wartosc.ToString();
                    rej.hex_l.Text = "0x" + wartosc.ToString("X");
                }
                change(rej, ktory, wartosc);
            }
            else if (pol == 2)
            {
                int sum;
                if (ktory)
                {
                    sum = wartosc + Int32.Parse(rej.dec_h.Text);
                    if (sum > 255)
                    {
                        sum -= 255;
                    }
                    rej.dec_h.Text = sum.ToString();
                    rej.hex_h.Text = "0x" + sum.ToString("X");
                }
                else
                {
                    sum = wartosc + Int32.Parse(rej.dec_l.Text);
                    if (sum > 255)
                    {
                        sum -= 255;
                    }
                    rej.dec_l.Text = sum.ToString();
                    rej.hex_l.Text = "0x" + sum.ToString("X");
                }
                change(rej, ktory, sum);
            }
            else
            {
                int sum;
                if (ktory)
                {
                    sum = Int32.Parse(rej.dec_h.Text) - wartosc;
                    if (sum < 0)
                    {
                        sum = -sum;
                    }
                    rej.dec_h.Text = sum.ToString();
                    rej.hex_h.Text = "0x" + sum.ToString("X");
                }
                else
                {
                    sum = Int32.Parse(rej.dec_l.Text) - wartosc;
                    if (sum < 0)
                    {
                        sum = -sum;
                    }
                    rej.dec_l.Text = sum.ToString();
                    rej.hex_l.Text = "0x" + sum.ToString("X");
                }
                change(rej, ktory, sum);
            }
            int temp = (Int32.Parse(rej.dec_l.Text) + 256 * Int32.Parse(rej.dec_h.Text));

            rej.cal_d.Text = temp.ToString();
            rej.cal_h.Text = "0x" + temp.ToString("X");
        }
Esempio n. 6
0
 private void init()
 {
     this.stos.AH = new bool[8];
     this.stos.AL = new bool[8];
     this.stos.BH = new bool[8];
     this.stos.BL = new bool[8];
     this.stos.CH = new bool[8];
     this.stos.CL = new bool[8];
     this.stos.DH = new bool[8];
     this.stos.DL = new bool[8];
     this.ah_tab  = new System.Windows.Forms.Button[8];
     this.al_tab  = new System.Windows.Forms.Button[8];
     this.bh_tab  = new System.Windows.Forms.Button[8];
     this.bl_tab  = new System.Windows.Forms.Button[8];
     this.ch_tab  = new System.Windows.Forms.Button[8];
     this.cl_tab  = new System.Windows.Forms.Button[8];
     this.dh_tab  = new System.Windows.Forms.Button[8];
     this.dl_tab  = new System.Windows.Forms.Button[8];
     ax           = new rejestr();
     bx           = new rejestr();
     cx           = new rejestr();
     dx           = new rejestr();
     ah_tab[0]    = this.ah1;
     ah_tab[1]    = this.ah2;
     ah_tab[2]    = this.ah3;
     ah_tab[3]    = this.ah4;
     ah_tab[4]    = this.ah5;
     ah_tab[5]    = this.ah6;
     ah_tab[6]    = this.ah7;
     ah_tab[7]    = this.ah8;
     al_tab[0]    = this.al1;
     al_tab[1]    = this.al2;
     al_tab[2]    = this.al3;
     al_tab[3]    = this.al4;
     al_tab[4]    = this.al5;
     al_tab[5]    = this.al6;
     al_tab[6]    = this.al7;
     al_tab[7]    = this.al8;
     bh_tab[0]    = this.bh1;
     bh_tab[1]    = this.bh2;
     bh_tab[2]    = this.bh3;
     bh_tab[3]    = this.bh4;
     bh_tab[4]    = this.bh5;
     bh_tab[5]    = this.bh6;
     bh_tab[6]    = this.bh7;
     bh_tab[7]    = this.bh8;
     bl_tab[0]    = this.bl1;
     bl_tab[1]    = this.bl2;
     bl_tab[2]    = this.bl3;
     bl_tab[3]    = this.bl4;
     bl_tab[4]    = this.bl5;
     bl_tab[5]    = this.bl6;
     bl_tab[6]    = this.bl7;
     bl_tab[7]    = this.bl8;
     ch_tab[0]    = this.ch1;
     ch_tab[1]    = this.ch2;
     ch_tab[2]    = this.ch3;
     ch_tab[3]    = this.ch4;
     ch_tab[4]    = this.ch5;
     ch_tab[5]    = this.ch6;
     ch_tab[6]    = this.ch7;
     ch_tab[7]    = this.ch8;
     cl_tab[0]    = this.cl1;
     cl_tab[1]    = this.cl2;
     cl_tab[2]    = this.cl3;
     cl_tab[3]    = this.cl4;
     cl_tab[4]    = this.cl5;
     cl_tab[5]    = this.cl6;
     cl_tab[6]    = this.cl7;
     cl_tab[7]    = this.cl8;
     dh_tab[0]    = this.dh1;
     dh_tab[1]    = this.dh2;
     dh_tab[2]    = this.dh3;
     dh_tab[3]    = this.dh4;
     dh_tab[4]    = this.dh5;
     dh_tab[5]    = this.dh6;
     dh_tab[6]    = this.dh7;
     dh_tab[7]    = this.dh8;
     dl_tab[0]    = this.dl1;
     dl_tab[1]    = this.dl2;
     dl_tab[2]    = this.dl3;
     dl_tab[3]    = this.dl4;
     dl_tab[4]    = this.dl5;
     dl_tab[5]    = this.dl6;
     dl_tab[6]    = this.dl7;
     dl_tab[7]    = this.dl8;
     ax.tab_h     = ah_tab;
     ax.tab_l     = al_tab;
     ax.dec_h     = a_dec_h_t;
     ax.hex_h     = a_hex_h_t;
     ax.dec_l     = a_dec_l_t;
     ax.hex_l     = a_hex_l_t;
     ax.cal_d     = a_dec_x_t;
     ax.cal_h     = a_hex_x_t;
     bx.tab_h     = bh_tab;
     bx.tab_l     = bl_tab;
     bx.dec_h     = b_dec_h_t;
     bx.hex_h     = b_hex_h_t;
     bx.dec_l     = b_dec_l_t;
     bx.hex_l     = b_hex_l_t;
     bx.cal_d     = b_dec_x_t;
     bx.cal_h     = b_hex_x_t;
     cx.tab_h     = ch_tab;
     cx.tab_l     = cl_tab;
     cx.dec_h     = c_dec_h_t;
     cx.hex_h     = c_hex_h_t;
     cx.dec_l     = c_dec_l_t;
     cx.hex_l     = c_hex_l_t;
     cx.cal_d     = c_dec_x_t;
     cx.cal_h     = c_hex_x_t;
     dx.tab_h     = dh_tab;
     dx.tab_l     = dl_tab;
     dx.dec_h     = d_dec_h_t;
     dx.hex_h     = d_hex_h_t;
     dx.dec_l     = d_dec_l_t;
     dx.hex_l     = d_hex_l_t;
     dx.cal_d     = d_dec_x_t;
     dx.cal_h     = d_hex_x_t;
 }
Esempio n. 7
0
        private void wykonajRozkaz(string rozkaz, ref rejestr rej1, bool low1, ref rejestr rej2lubStala, bool low2)
        {
            switch (rozkaz)
            {
            case "MOV":
                if (low1 == true)
                {
                    if (low2 == true)
                    {
                        rej1.l = rej2lubStala.l;
                    }
                    else
                    {
                        rej1.l = rej2lubStala.h;
                    }
                    rej1.lLabel.Text = rej1.l.ToString();
                }
                else
                {
                    if (low2 == true)
                    {
                        rej1.h = rej2lubStala.l;
                    }
                    else
                    {
                        rej1.h = rej2lubStala.h;
                    }
                    rej1.hLabel.Text = rej1.h.ToString();
                }
                ustawBity(rej1, low1);
                break;

            case "ADD":
                if (low1 == true)
                {
                    if (low2 == true)
                    {
                        rej1.l += rej2lubStala.l;
                    }
                    else
                    {
                        rej1.l += rej2lubStala.h;
                    }
                    if (rej1.l > 255)
                    {
                        rej1.l = rej1.l - 255;
                    }
                    rej1.lLabel.Text = rej1.l.ToString();
                }
                else
                {
                    if (low2 == true)
                    {
                        rej1.h += rej2lubStala.l;
                    }
                    else
                    {
                        rej1.h += rej2lubStala.h;
                    }
                    if (rej1.h > 255)
                    {
                        rej1.h = rej1.h - 255;
                    }
                    rej1.hLabel.Text = rej1.h.ToString();
                }
                ustawBity(rej1, low1);
                break;

            case "SUB":
                if (low1 == true)
                {
                    if (low2 == true)
                    {
                        rej1.l -= rej2lubStala.l;
                    }
                    else
                    {
                        rej1.l -= rej2lubStala.h;
                    }
                    if (rej1.l < 0)
                    {
                        rej1.l = -rej1.l;
                    }
                    rej1.lLabel.Text = rej1.l.ToString();
                }
                else
                {
                    if (low2 == true)
                    {
                        rej1.h -= rej2lubStala.l;
                    }
                    else
                    {
                        rej1.h -= rej2lubStala.h;
                    }
                    if (rej1.h < 0)
                    {
                        rej1.h = -rej1.h;
                    }
                    rej1.hLabel.Text = rej1.h.ToString();
                }
                ustawBity(rej1, low1);
                break;
            }
        }
Esempio n. 8
0
        private void wykonajRozkaz(string rozkaz, ref rejestr rej1, bool low1, ref rejestr rej2lubStala, bool low2)
        {
            string zawartosc_stosu = ""; // zmienna uzyta w petli odczytu stosu

            switch (rozkaz)
            {
            case "MOV":
                if (low1 == true)
                {
                    if (low2 == true)
                    {
                        rej1.l = rej2lubStala.l;
                    }
                    else
                    {
                        rej1.l = rej2lubStala.h;
                    }
                }
                else
                {
                    if (low2 == true)
                    {
                        rej1.h = rej2lubStala.l;
                    }
                    else
                    {
                        rej1.h = rej2lubStala.h;
                    }
                }
                ustawBityILabelki(rej1, low1);
                statusWykonania = " >> wykonano <<";
                break;

            case "ADD":
                if (low1 == true)
                {
                    if (low2 == true)
                    {
                        rej1.l += rej2lubStala.l;
                    }
                    else
                    {
                        rej1.l += rej2lubStala.h;
                    }
                    if (rej1.l > 255)
                    {
                        rej1.l = rej1.l - 255;
                    }
                }
                else
                {
                    if (low2 == true)
                    {
                        rej1.h += rej2lubStala.l;
                    }
                    else
                    {
                        rej1.h += rej2lubStala.h;
                    }
                    if (rej1.h > 255)
                    {
                        rej1.h = rej1.h - 255;
                    }
                }
                ustawBityILabelki(rej1, low1);
                statusWykonania = " >> wykonano <<";
                break;

            case "SUB":
                if (low1 == true)
                {
                    if (low2 == true)
                    {
                        rej1.l -= rej2lubStala.l;
                    }
                    else
                    {
                        rej1.l -= rej2lubStala.h;
                    }
                    if (rej1.l < 0)
                    {
                        rej1.l = -rej1.l;
                    }
                }
                else
                {
                    if (low2 == true)
                    {
                        rej1.h -= rej2lubStala.l;
                    }
                    else
                    {
                        rej1.h -= rej2lubStala.h;
                    }
                    if (rej1.h < 0)
                    {
                        rej1.h = -rej1.h;
                    }
                }
                ustawBityILabelki(rej1, low1);
                statusWykonania = " >> wykonano <<";
                break;

            case "INT05":
                czekaj_na_messageBox = true;
                MessageBox.Show("Wciśnięto klawisz: Print-screen", "INT 05");
                czekaj_na_messageBox = false;
                break;

            case "INT16":
                if (przyklady_auto == true)
                {
                    ax.h = 0x10;     // funkcja 10h
                    ustawBityILabelki(ax, false);
                }
                if (ax.h == 16)
                {
                    int    kodZnaku;
                    Random r = new Random();
                    kodZnaku = r.Next(97, 122);
                    ax.l     = kodZnaku;
                    ax.h     = 28;  //scancode = 1C (key pressed)
                    ustawBityILabelki(ax, true);
                    ustawBityILabelki(ax, false);
                    char c = Convert.ToChar(ax.l);
                    czekaj_na_messageBox = true;
                    MessageBox.Show("Wciśnięto klawisz: " + c + " ASCII: " +
                                    Convert.ToString(ax.l, 16) + " Scan code: 1C", "INT 16");
                    czekaj_na_messageBox = false;
                    statusWykonania      = " >> wykonano <<";
                }
                else
                {
                    statusWykonania = " >> nieobsługiwana funkcja: "
                                      + Convert.ToString(ax.h, 16) + "H <<";
                }
                break;

            case "INT17":
                if (przyklady_auto == true)
                {
                    ax.h = 0;     // funkcja 00h
                    ax.l = 0x61;  // ASCII code of character to be printed: 'a'
                    dx.h = 0;
                    dx.l = 1;     // DX (DH + DL) = printer number(i.e. 0 = LPT1, 1 = LPT2, 2 = LPT3)
                    ustawBityILabelki(ax, false);
                    ustawBityILabelki(ax, true);
                    ustawBityILabelki(dx, false);
                    ustawBityILabelki(dx, true);
                }
                if (ax.h == 0 && dx.h == 0 && (dx.l == 0 || dx.l == 1 || dx.l == 2))
                {
                    char c = Convert.ToChar(ax.l);
                    czekaj_na_messageBox = true;
                    MessageBox.Show("Na drukarce LPT" + (dx.l + 1).ToString() +
                                    " wydrukowano znak: " + c, "INT 17");
                    ax.h = 64;
                    ustawBityILabelki(ax, false);
                    rej1.hLabel.Text     = "64";
                    czekaj_na_messageBox = false;
                    statusWykonania      = " >> wykonano <<";
                }
                else
                {
                    statusWykonania = " >> nieobsługiwana funkcja lub błędne parametry: " + Convert.ToString(ax.h, 16) + "H <<";
                }
                break;

            case "INT19":
                czekaj_na_messageBox = true;
                MessageBox.Show("system reboot", "INT 19");
                czekaj_na_messageBox = false;
                break;

            case "INT1A":
                if (przyklady_auto == true)
                {
                    ax.h = 3;        // funkcja 03h
                    cx.h = 0x16;     // hour
                    cx.l = 0x49;     // minutes
                    dx.h = 0x30;     // seconds
                    dx.l = 1;        // daylight time
                    ustawBityILabelki(ax, false);
                    ustawBityILabelki(cx, false);
                    ustawBityILabelki(cx, true);
                    ustawBityILabelki(dx, false);
                    ustawBityILabelki(dx, true);
                }
                if (ax.h == 3 &&
                    (Enumerable.Range(0x00, 9).Contains(cx.h) ||      // cx.h , godzina, 00-23
                     Enumerable.Range(0x10, 9).Contains(cx.h) ||
                     Enumerable.Range(0x20, 9).Contains(cx.h)) &&
                    (Enumerable.Range(0x00, 9).Contains(cx.l) ||      // cx.l, minuty, 00-59
                     Enumerable.Range(0x10, 9).Contains(cx.l) ||
                     Enumerable.Range(0x20, 9).Contains(cx.l) ||
                     Enumerable.Range(0x30, 9).Contains(cx.l) ||
                     Enumerable.Range(0x40, 9).Contains(cx.l) ||
                     Enumerable.Range(0x50, 9).Contains(cx.l)) &&
                    (Enumerable.Range(0x00, 9).Contains(dx.h) ||      // dx.h, sekundy, 00-59
                     Enumerable.Range(0x10, 9).Contains(dx.h) ||
                     Enumerable.Range(0x20, 9).Contains(dx.h) ||
                     Enumerable.Range(0x30, 9).Contains(dx.h) ||
                     Enumerable.Range(0x40, 9).Contains(dx.h) ||
                     Enumerable.Range(0x50, 9).Contains(dx.h)) &&
                    (dx.l == 0 || dx.l == 1))     // dx.l : 00h standard time, 01h daylight time
                {
                    string godzina        = Convert.ToString(cx.h, 16);
                    string minuta         = Convert.ToString(cx.l, 16);
                    string sekunda        = Convert.ToString(dx.h, 16);
                    string letniLubZimowy = "";
                    if (dx.l == 0)
                    {
                        letniLubZimowy = "czas zimowy";
                    }
                    else
                    {
                        letniLubZimowy = "czas letni";
                    }
                    czekaj_na_messageBox = true;
                    MessageBox.Show("Ustawiono czas w zegarze czasu rzeczywistego: "
                                    + godzina + ":" + minuta + ":" + sekunda + " " + letniLubZimowy, "INT 1A");
                    czekaj_na_messageBox = false;
                    statusWykonania      = " >> wykonano <<";
                }
                else
                {
                    statusWykonania = " >> nieobsługiwana funkcja lub błędne parametry: "
                                      + Convert.ToString(ax.h, 16) + "H <<";
                }
                break;

            case "INT10":
                if (przyklady_auto == true)
                {
                    ax.h = 0;
                    ustawBityILabelki(ax, false);
                    ax.l = 8;
                    ustawBityILabelki(ax, true);
                }
                if (ax.h == 0)
                {
                    czekaj_na_messageBox = true;
                    switch (ax.l)
                    {
                    case 0:
                        MessageBox.Show("Ustawiono tryb video: 40x25 Black & White", "INT 10");
                        statusWykonania = " >> wykonano <<";
                        break;

                    case 2:
                        MessageBox.Show("Ustawiono tryb video: 40x25 Color", "INT 10");
                        statusWykonania = " >> wykonano <<";
                        break;

                    case 4:
                        MessageBox.Show("Ustawiono tryb video: 80x25 Black & White", "INT 10");
                        statusWykonania = " >> wykonano <<";
                        break;

                    case 8:
                        MessageBox.Show("Ustawiono tryb video: 80x25 Color", "INT 10");
                        statusWykonania = " >> wykonano <<";
                        break;

                    case 16:
                        MessageBox.Show("Ustawiono tryb video: 320x200 Color", "INT 10");
                        statusWykonania = " >> wykonano <<";
                        break;

                    case 32:
                        MessageBox.Show("Ustawiono tryb video: 320x200 Black & White", "INT 10");
                        statusWykonania = " >> wykonano <<";
                        break;

                    case 64:
                        MessageBox.Show("Ustawiono tryb video: 640x200 Black & White", "INT 10");
                        statusWykonania = " >> wykonano <<";
                        break;

                    case 128:
                        MessageBox.Show("Ustawiono tryb video: Monochrome only", "INT 10");
                        statusWykonania = " >> wykonano <<";
                        break;

                    default:
                        statusWykonania = " >> nieobsługiwana wartość AL: " + Convert.ToString(ax.l, 16) + "H <<";
                        break;
                    }
                    czekaj_na_messageBox = false;
                }
                else
                {
                    statusWykonania = " >> nieobsługiwana funkcja: " + Convert.ToString(ax.h, 16) + "H <<";
                }
                break;

            case "INT11":
                ax.l = 3;         //00000110
                ax.h = 2;         //00000010
                ustawBityILabelki(ax, true);
                ustawBityILabelki(ax, false);
                czekaj_na_messageBox = true;
                MessageBox.Show("System Information zwrócone w rejestrze AH, AL", "INT 11");
                czekaj_na_messageBox = false;
                statusWykonania      = " >> wykonano <<";
                break;

            case "INT13":
                if (przyklady_auto == true)
                {
                    ax.h = 1;
                    ustawBityILabelki(ax, false);
                    dx.l = 128;
                    ustawBityILabelki(dx, true);
                }
                if (ax.h == 1)
                {
                    ax.h = 7;
                    ustawBityILabelki(ax, false);
                    czekaj_na_messageBox = true;
                    MessageBox.Show("Drive initialization error", "INT 13");
                    czekaj_na_messageBox = false;
                    statusWykonania      = " >> wykonano <<";
                }
                else
                {
                    statusWykonania = " >> nieobsługiwana funkcja: " + Convert.ToString(ax.h, 16) + "H <<";
                }
                break;

            case "INT14":
                if (przyklady_auto == true)
                {
                    ax.h = 1;
                    int    kodZnaku;
                    Random r = new Random();
                    kodZnaku = r.Next(97, 122);
                    ax.l     = kodZnaku;
                    dx.l     = 0;   //serial port nr 0 (pierwszy)
                    ustawBityILabelki(ax, true);
                    ustawBityILabelki(ax, false);
                    ustawBityILabelki(dx, true);
                }
                if (ax.h == 1)
                {
                    ax.h = 1;     //data ready
                    ustawBityILabelki(ax, false);
                    czekaj_na_messageBox = true;
                    char c = Convert.ToChar(ax.l);
                    MessageBox.Show("Send character: " + c, "INT 14");
                    czekaj_na_messageBox = false;
                    statusWykonania      = " >> wykonano <<";
                }
                else
                {
                    statusWykonania = " >> nieobsługiwana funkcja: " + Convert.ToString(ax.h, 16) + "H <<";
                }
                break;

            case "INT15":
                if (przyklady_auto == true)
                {
                    ax.h = 0x86;
                    cx.h = 0;
                    cx.l = 0;
                    dx.h = 1;
                    dx.l = 0x2C;             //h + l = 1 0010 1100 czyli 300ms
                    ustawBityILabelki(ax, false);
                    ustawBityILabelki(cx, false);
                    ustawBityILabelki(cx, true);
                    ustawBityILabelki(dx, false);
                    ustawBityILabelki(dx, true);
                }
                if (ax.h == 0x86)
                {
                    string tempHex = "";
                    long   tempDec = 0;
                    tempHex = "0x" + Convert.ToString(cx.h, 16) + Convert.ToString(cx.l, 16) + Convert.ToString(dx.h, 16) + Convert.ToString(dx.l, 16);
                    tempDec = Convert.ToInt64(tempHex, 16);
                    czekaj_na_messageBox = true;
                    MessageBox.Show("Wait: " + tempDec + " microseconds", "INT 15");
                    czekaj_na_messageBox = false;
                    statusWykonania      = " >> wykonano <<";
                }
                else
                {
                    statusWykonania = " >> nieobsługiwana funkcja: " + Convert.ToString(ax.h, 16) + "H <<";
                }
                break;

            case "PUSH":
                if (low1 == true)
                {
                    stos.Push(rej1.l);     // wrzucamy rej1.l na stos
                }
                else
                {
                    stos.Push(rej1.h);     // wrzucamy rej1.h na stos
                }

                // wyswietlamy stos w text boxie - uzywając własnej implementacji stosu
                zawartosc_stosu   = stos.Wyswietl_stos();
                stos_textbox.Text = zawartosc_stosu;
                ustawBityILabelki(rej1, low1);
                statusWykonania = " >> wykonano <<";
                break;

            case "POP":
                if (low1 == true)
                {
                    rej1.l = (int)stos.Pop();      // pobieramy wartosc ze stosu do rej1.l
                }
                else
                {
                    rej1.h = (int)stos.Pop();      // pobieramy wartosc ze stosu do rej1.h
                }
                ustawBityILabelki(rej1, low1);

                // wyswietlamy stos w text boxie - uzywając własnej implementacji stosu
                zawartosc_stosu   = stos.Wyswietl_stos();
                stos_textbox.Text = zawartosc_stosu;

                statusWykonania = " >> wykonano <<";
                break;
            }
        }