Esempio n. 1
0
        public void CheckLoad_d16PC_ToA5()
        {
            // LEA <ea>,An
            // 0100 1011 1111 1010  0x4BFA
            // 0000 0000 0111 1100  0x007C

            // LEA (d16,PC),A5
            // LEA (124,PC),A5

            byte[] data = new byte[]
            {
                0x4B, 0xFA, 0x00, 0x7C
            };

            MegadriveState state = new MegadriveState(new Data(data), 0x00000000, 0x00000000, 0x000000, 0x3FFFFF, 0x0FF0000, 0xFFFFFF);

            state.FetchOpCode();

            var opcode = new LEA(state);

            Assert.That(opcode.Assembly, Is.EqualTo("LEA ($007C,PC),A5"));
            Assert.That(opcode.Size, Is.EqualTo(Size.Long));

            Assert.That(state.PC, Is.EqualTo(0x00000004));
            Assert.That(state.ReadAReg(0x5), Is.EqualTo(0x7E));
        }
Esempio n. 2
0
        public void CheckLoad_A0_ToA1()
        {
            // LEA <ea>,An
            // 0100 0011 1101 0000  0x43D0
            // LEA (A0),A1

            byte[] data = new byte[]
            {
                0x43, 0xD0
            };

            MegadriveState state = new MegadriveState(new Data(data), 0x00000000, 0x00000000, 0x000000, 0x3FFFFF, 0x0FF0000, 0xFFFFFF);

            state.WriteAReg(0x0, 0x00FF0000);
            state.WriteByte(0x00FF0000, 0xAA);
            state.FetchOpCode();

            var opcode = new LEA(state);

            Assert.That(opcode.Assembly, Is.EqualTo("LEA (A0),A1"));
            Assert.That(opcode.Size, Is.EqualTo(Size.Long));

            Assert.That(state.PC, Is.EqualTo(0x00000002));
            Assert.That(state.ReadAReg(0x0), Is.EqualTo(0x00FF0000));
            Assert.That(state.ReadAReg(0x1), Is.EqualTo(0x00FF0000));
        }
Esempio n. 3
0
 public PaperItem(string s)
 {
     this.s     = s;
     this.JyeID = "";
     if (s.Contains("<input name=\"QA_") && s.Contains("type=\"radio\" class=\"radio\" />"))
     {
         s = Regex.Replace(s, "<input name=\"QA_[^<>]*type=\"radio\" class=\"radio\" />", "");
     }
     //while (s.Contains("<input name=\"QA_") && s.Contains("type=\"radio\" class=\"radio\" />"))
     //    s = Regex.Replace(s, "<input name[^<>]*/>","",RegexOptions.Multiline | RegexOptions.Singleline | RegexOptions.IgnoreCase);
     if (s.Contains("<fieldset id=\"") && s.Contains("\" class=\"quesborder\" s=\"bio2\">"))
     {
         this.JyeID = s.Substring("<fieldset id=\"".Length, 36);
     }
     BE1 = DgvTools.GetEqualValue(s, B1, E1);
     BE2 = DgvTools.GetEqualValue(s, B2, E2);
     if (BE2 == "")
     {
         int pos = 0;
         while (pos >= 0)
         {
             string item = DgvTools.GetEqualValue(s, BA, EA, ref pos) + EA;
             if (pos == -1)
             {
                 break;
             }
             LEA.Add(item);
             string item2 = DgvTools.GetEqualValue(s, "<div class=\"sanwser\">", "</div>", ref pos) + "</div>";
             if (pos == -1)
             {
                 break;
             }
             LEA2.Add(item2);
         }
     }
     else
     {
         //List<string>
         ABCD = new List <string>();
         string IB  = "<label class=\"";
         string IE  = "</label>";
         int    pos = 0;
         while (pos >= 0)
         {
             string item = DgvTools.GetEqualValue(s, IB, IE, ref pos);
             if (pos == -1)
             {
                 break;
             }
             ABCD.Add(item);
         }
         if (ABCD.Count > 0) //openwidth
         {
             optionwidth = DgvTools.GetEqualValue(BE2, "<td style=\"width:", "%\"");
             if (optionwidth.StartsWith("<td style=\"width:"))
             {
                 optionwidth = optionwidth.Substring("<td style=\"width:".Length);
             }
             if (optionwidth == "")
             {
                 optionwidth = "98";
             }
         }
         //
         string value = "";
         foreach (string str in ABCD)
         {
             string abcd = "";
             if (str.StartsWith("<label class=\" s\">"))
             {
                 abcd    = str.Substring("<label class=\" s\">".Length, 1);
                 value   = str.Substring("<label class=\" s\">".Length + 2);
                 ANSWER += abcd;
             }
             else
             {
                 abcd  = str.Substring("<label class=\"\">".Length, 1);
                 value = str.Substring("<label class=\"\">".Length + 2);
             }
             if (abcd == "A")
             {
                 A = value;
             }
             else if (abcd == "B")
             {
                 B = value;
             }
             else if (abcd == "C")
             {
                 C = value;
             }
             else if (abcd == "D")
             {
                 D = value;
             }
         }
     }
 }
Esempio n. 4
0
 public AnonymousInstruction(LEA parent)
 {
     this.parent = parent;
 }