Beispiel #1
0
 public override bool TryPeekPointer(EndianImageReader rdr, out uint target)
 {
     if (!rdr.IsValidOffset(rdr.Offset + 4 - 1))
     {
         target = 0;
         return(false);
     }
     else
     {
         target = rdr.PeekBeUInt32(0);
         return(true);
     }
 }
Beispiel #2
0
        private void EmitUnitTest()
        {
            if (seen.Contains(dasm.Current.Mnemonic))
            {
                return;
            }
            seen.Add(dasm.Current.Mnemonic);

            var bytes = rdr.PeekBeUInt32(-dasm.Current.Length);

            Console.WriteLine("        [Test]");
            Console.WriteLine("        public void PaRiscRw_" + dasm.Current.Mnemonic + "()");
            Console.WriteLine("        {");
            Console.WriteLine("            BuildTest(\"{0:X8}\");\t// {1}", bytes, dasm.Current.ToString());
            Console.WriteLine("            AssertCode(");
            Console.WriteLine("                \"0|L--|00100000({0}): 1 instructions\",", dasm.Current.Length);
            Console.WriteLine("                \"1|L--|@@@\");");
            Console.WriteLine("        }");
            Console.WriteLine("");
        }
Beispiel #3
0
 private bool AbsoluteJumpCall(EndianImageReader rdr, uint opcode, out uint target)
 {
     if ((opcode & 1) == 0)
     {
         if (rdr.IsValidOffset(rdr.Offset + 2u))
         {
             target = (uint)(int)rdr.PeekBeInt16(2);
             return(true);
         }
     }
     else
     {
         if (rdr.IsValidOffset(rdr.Offset + 4u))
         {
             target = rdr.PeekBeUInt32(2);
             return(true);
         }
     }
     target = 0;
     return(false);
 }