public override void Discompile(Program p, int address, bool direct)
        {
            //p.WriteLine("ZZ_ONCEBRANCH(0x{0:X},{1});",address,p.Clocks);return;
            if (!direct)
            {
                throw new PSXException();
            }
            Word nextword   = p[address + 4];
            Word branchword = p[address + offset * 4 + 4];

            if (rs == Register.R0)
            {
                p.WriteLine("if ({0})", rt);
            }
            else if (rt == Register.R0)
            {
                p.WriteLine("if ({0})", rs);
            }
            else
            {
                p.WriteLine("if ({0} != {1})", rs, rt);
            }
            p.WriteLine("{{");
            p.Indent();
            nextword.Discompile(false);
            p.WriteClocks(1, branchword.Address);
            p.WriteLine("goto {0};", branchword.Label);
            p.Unindent();
            p.WriteLine("}}");
        }
Exemple #2
0
 public override void Discompile(Program p,int address,bool direct)
 {
     //p.WriteLine("ZZ_ONCEBRANCH(0x{0:X},{1});",address,p.Clocks);return;
     if (!direct)
         throw new PSXException();
     Word nextword = p[address + 4];
     Word branchword = p[address + offset * 4 + 4];
     if (rs == Register.R0)
     {
         nextword.Discompile(false);
         p.WriteClocks(1,branchword.Address);
         p.WriteLine("goto {0};",branchword.Label);
     }
     else
     {
         p.WriteLine("if ((int32_t){0} >= 0)",rs);
         p.WriteLine("{{");
         p.Indent();
         nextword.Discompile(false);
         p.WriteClocks(1,branchword.Address);
         p.WriteLine("goto {0};",branchword.Label);
         p.Unindent();
         p.WriteLine("}}");
     }
 }
Exemple #3
0
        public override void Discompile(Program p, int address, bool direct)
        {
            //p.WriteLine("ZZ_ONCEBRANCH(0x{0:X},{1});",address,p.Clocks);return;
            if (!direct)
            {
                throw new PSXException();
            }
            Word nextword   = p[address + 4];
            Word branchword = p[address + offset * 4 + 4];

            p.WriteLine("if ((int32_t){0} < 0)", rs);
            p.WriteLine("{{");
            p.Indent();
            nextword.Discompile(false);
            p.WriteClocks(1, branchword.Address);
            p.WriteLine("goto {0};", branchword.Label);
            //p.WriteLine("return 0x{0:X};",branchword.Address);
            p.Unindent();
            p.WriteLine("}}");
        }