private int unpackAddr(int paddr,boolean raddr)
    {
        int addr = 0;
        int offset = 0;

        switch (version) {
            case 1 :
            case 2 :
            case 3 : addr = 2 * paddr;
                     break;
            case 4 :
            case 5 : addr = 4 * paddr;
                     break;
            case 6 :
            case 7 : if (raddr)
                        offset = memory.fetchWord(0x28);
                     else
                        offset = memory.fetchWord(0x2a);
                     addr = (4 * addr) + (8 * offset);
                     break;
            case 8 : addr = 8 * paddr;
                     break;
        }

        return addr;
    }