OpenCores
URL https://opencores.org/ocsvn/thor/thor/trunk

Subversion Repositories thor

[/] [thor/] [trunk/] [software/] [emuThor/] [source/] [clsDisassem.cpp] - Diff between revs 32 and 35

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 32 Rev 35
Line 199... Line 199...
std::string clsDisassem::Disassem(int ad, int *nb)
std::string clsDisassem::Disassem(int ad, int *nb)
{
{
        int byt;
        int byt;
        int opcode, func;
        int opcode, func;
        int n;
        int n;
        __int64 val, disp;
        __int64 val, disp, amt;
        int rv;
        int rv;
        int b1, b2, b3, b4;
        int b1, b2, b3, b4;
        int Ra,Rb,Rc,Rt,Sprn,Sg,Sc,Sz;
        int Ra,Rb,Rc,Rt,Sprn,Sg,Sc,Sz;
        int Cr,Ct,Tn;
        int Cr,Ct,Tn;
        int Pn;
        int Pn;
Line 391... Line 391...
                return std::string(buf);
                return std::string(buf);
        }
        }
        if ((opcode & 0xF0)==0x30) {
        if ((opcode & 0xF0)==0x30) {
                b1 = system1.ReadByte(ad);
                b1 = system1.ReadByte(ad);
                ad++;
                ad++;
                disp = (b1 << 4) | (opcode & 0xF);
                disp = b1 | ((opcode & 0xF) << 8);
                if (disp & 0x800)
                if (disp & 0x800)
                        disp |= 0xFFFFFFFFFFFFF000LL;
                        disp |= 0xFFFFFFFFFFFFF000LL;
                sprintf(&buf[strlen(buf)], " BR $%LLX", disp + ad);
                sprintf(&buf[strlen(buf)], " BR $%LLX", disp + ad);
                if (nb) *nb = 3;
                if (nb) *nb = 3;
                imm_prefix = false;
                imm_prefix = false;
Line 571... Line 571...
                sprintf(&buf[strlen(buf)], " EORI r%d,r%d,#$%I64X", Rt, Ra, val);
                sprintf(&buf[strlen(buf)], " EORI r%d,r%d,#$%I64X", Rt, Ra, val);
                if (nb) *nb = 5;
                if (nb) *nb = 5;
                imm_prefix = false;
                imm_prefix = false;
                return std::string(buf);
                return std::string(buf);
 
 
 
        case INC:
 
                b1 = system1.ReadByte(ad);
 
                ad++;
 
                b2 = system1.ReadByte(ad);
 
                ad++;
 
                b3 = system1.ReadByte(ad);
 
                ad++;
 
                b4 = system1.ReadByte(ad);
 
                ad++;
 
                Ra = b1 & 0x3f;
 
                Sz = (b1 >> 6) | ((b2 & 1) << 2);
 
                disp = (b2 >> 4) | ((b3 & 31) << 4);
 
                if (disp & 0x100)
 
                        disp |= 0xFFFFFFFFFFFFFF00LL;
 
                Sg = b3 >> 5;
 
                amt = b4;
 
                if (amt & 0x80)
 
                        amt |= 0xFFFFFFFFFFFFFF00LL;
 
                sprintf(&buf[strlen(buf)], " INC.%c %s:$%I64X[r%d],#%I64d",
 
                        Sz==0 ? 'B' : Sz==1 ? 'C' : Sz==2 ? 'H' : 'W',
 
                        SegName(Sg), disp, Ra, amt);
 
                if (nb) *nb = 6;
 
                imm_prefix = false;
 
                return std::string(buf);
 
 
        case JSR:
        case JSR:
                b1 = system1.ReadByte(ad);
                b1 = system1.ReadByte(ad);
                ad++;
                ad++;
                b2 = system1.ReadByte(ad);
                b2 = system1.ReadByte(ad);
                ad++;
                ad++;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.