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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [sw/] [zasm/] [zopcodes.cpp] - Diff between revs 89 and 95

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

Rev 89 Rev 95
Line 99... Line 99...
        "CLRF", 0xffc7cfff, 0x71078000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(3,19),
        "CLRF", 0xffc7cfff, 0x71078000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(3,19),
        "CLRF", 0xffc7cfff, 0x7907c000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(3,19),
        "CLRF", 0xffc7cfff, 0x7907c000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(3,19),
        // CLR -- a LDI of zero
        // CLR -- a LDI of zero
        //      0.rrrr.1011.iiiiiii--
        //      0.rrrr.1011.iiiiiii--
        //      0rrr r101 1...
        //      0rrr r101 1...
        "CLR",  0x878fffff, 0x05800000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        "CLR",  0x87ffffff, 0x05800000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        // HALT
        // HALT
        //      0.1110.00011.ccc.0.0000000000010
        //      0.1110.00011.ccc.0.0000000000010
        //      0111.0000.11cc.c000.0000.0000.0000.0010
        //      0111.0000.11cc.c000.0000.0000.0000.0010
        "HALT", 0xffc7ffff, 0x70c00010, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(3,19),
        "HALT", 0xffc7ffff, 0x70c00010, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(3,19),
        // The "wait" instruction is identical, with the only difference being
        // The "wait" instruction is identical, with the only difference being
Line 122... Line 122...
        // 0.1111.1011.ii.iiii.iiii.iiii.iiii.iiii.iiii
        // 0.1111.1011.ii.iiii.iiii.iiii.iiii.iiii.iiii
        // 0111.1101.1iii.iiii.iiii.iiii.iiii.iiii      LDI x,PC
        // 0111.1101.1iii.iiii.iiii.iiii.iiii.iiii      LDI x,PC
        "JMP",  0xff800000, 0x7d800000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(23,0), ZIP_OPUNUSED,
        "JMP",  0xff800000, 0x7d800000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(23,0), ZIP_OPUNUSED,
        // 0.1111.00010.ccc0.iiiii.iiii.iiii.iiii.iiii
        // 0.1111.00010.ccc0.iiiii.iiii.iiii.iiii.iiii
        // 0111.1000.10cc.c0ii.iiii.iiii.iiii.iiii      LOD (PC),PC
        // 0111.1000.10cc.c0ii.iiii.iiii.iiii.iiii      LOD (PC),PC
        "LJMP", 0xffc7ffff, 0x7c87c000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        "LJMP", 0xffffffff, 0x7c87c000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
 
        "LJMP", 0xffc7ffff, 0x7c87c001, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(3,19),
        // NOT : XOR w/ -1
        // NOT : XOR w/ -1
        //      0.rrrr.00100.ccc.0111.11111111111
        //      0.rrrr.00100.ccc.0111.11111111111
        //      0rrr.r001.00cc.c011.f.f.f.f
        //      0rrr.r001.00cc.c011.f.f.f.f
        "NOT",  0x87c7ffff, 0x0103ffff, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(3,19),
        "NOT",  0x87c7ffff, 0x0103ffff, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(3,19),
        // General instructions
        // General instructions
Line 221... Line 222...
        //
        //
        //
        //
        //
        //
        //      16-bit instructions, high side
        //      16-bit instructions, high side
        //
        //
 
        // 
        //      1.1111.00010.xcc.0iiii.xxxx.xxxxx.xxxxx
        //      1.1111.00010.xcc.0iiii.xxxx.xxxxx.xxxxx
        //      1111.1000.10xc.c0ii.iixx.xxxx.xxxx.xxxx
        //      1111.1000.10xc.c0ii.iixx.xxxx.xxxx.xxxx
        "BRA",  0xffd40000, 0xf8800000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_OPUNUSED,
        "BRA",  0xffd40000, 0xf8800000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_OPUNUSED,
        "BLT",  0xffd40000, 0xf8840000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_OPUNUSED,
        "BLT",  0xffd40000, 0xf8840000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_OPUNUSED,
        "BRZ",  0xffd40000, 0xf8900000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_OPUNUSED,
        "BRZ",  0xffd40000, 0xf8900000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_OPUNUSED,
        "BNZ",  0xffd40000, 0xf8940000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_OPUNUSED,
        "BNZ",  0xffd40000, 0xf8940000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_OPUNUSED,
        // LDI  1.rrrr.1011x.ccc.iiiii  -> 1rrr r101 1xcc ciii ii
        // LDI  1.rrrr.1011x.ccc.iiiii  -> 1rrr r101 1xcc ciii ii
        "CLR",  0x87c7c000, 0x85800000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        "CLR",  0x8787c000, 0x85800000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        // JMP  1.1111.01111.ccc.1rrrr  -> 1111 1011 11cc c1rr rr (Mov to PC)
        // JMP  1.1111.01111.ccc.1rrrr  -> 1111 1011 11cc c1rr rr (Mov to PC)
        "JMP",  0xffc40000, 0xfbc40000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_REGFIELD(14), ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        "JMP",  0xffc40000, 0xfbc40000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_REGFIELD(14), ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        // XOR  1.rrrr.00100.ccc.01111  -> 1rrr r001 00cc c011 11
        // XOR  1.rrrr.00100.ccc.01111  -> 1rrr r001 00cc c011 11
        "NOT",  0x87c7c000, 0x8103c000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        "NOT",  0x87c7c000, 0x8103c000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        // General instructions, top half
        // General instructions, top half
Line 295... Line 297...
        "DIVU", 0x87c40000, 0x85040000, ZIP_REGFIELD(27), ZIP_REGFIELD(27), ZIP_REGFIELD(14), ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        "DIVU", 0x87c40000, 0x85040000, ZIP_REGFIELD(27), ZIP_REGFIELD(27), ZIP_REGFIELD(14), ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        //
        //
        "DIVS", 0x87c40000, 0x85400000, ZIP_REGFIELD(27), ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_BITFIELD(2,19),
        "DIVS", 0x87c40000, 0x85400000, ZIP_REGFIELD(27), ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_BITFIELD(2,19),
        "DIVS", 0x87c40000, 0x85440000, ZIP_REGFIELD(27), ZIP_REGFIELD(27), ZIP_REGFIELD(14), ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        "DIVS", 0x87c40000, 0x85440000, ZIP_REGFIELD(27), ZIP_REGFIELD(27), ZIP_REGFIELD(14), ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        //
        //
        "CLR",  0x87c7c000, 0x85800000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        "CLR",  0x8787c000, 0x85800000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        "LDI",  0x87c00000, 0x85800000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(5,14), ZIP_BITFIELD(2,19),
        "LDI",  0x87c00000, 0x85800000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(5,14), ZIP_BITFIELD(2,19),
        //
        //
        "NOOP", 0xf7c00000, 0xf6000000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        "NOOP", 0xf7c00000, 0xf6000000, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        //
        //
        "BRK",  0xf7c00000, 0xf6400000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_BITFIELD(2,19),
        "BRK",  0xf7c00000, 0xf6400000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,14), ZIP_BITFIELD(2,19),
Line 340... Line 342...
        "BRA",  0x80203ff0, 0x80003c40, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,0), ZIP_OPUNUSED,
        "BRA",  0x80203ff0, 0x80003c40, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,0), ZIP_OPUNUSED,
        "BLT",  0x80383ff0, 0x80283c40, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,0), ZIP_OPUNUSED,
        "BLT",  0x80383ff0, 0x80283c40, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,0), ZIP_OPUNUSED,
        "BRZ",  0x80383ff0, 0x80303c40, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,0), ZIP_OPUNUSED,
        "BRZ",  0x80383ff0, 0x80303c40, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,0), ZIP_OPUNUSED,
        "BNZ",  0x80383ff0, 0x80383c40, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,0), ZIP_OPUNUSED,
        "BNZ",  0x80383ff0, 0x80383c40, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_IMMFIELD(4,0), ZIP_OPUNUSED,
        //
        //
 
        "LJMP", 0x80203fff, 0x80003e5f, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
 
        //
        //
        //
        // CLRF ... an XOR w/ self instruction
        // CLRF ... an XOR w/ self instruction
        //      0.rrrr.00100.ccc.1.rrrr.iiiii---
        //      0.rrrr.00100.ccc.1.rrrr.iiiii---
        //      0rrr r001 00cc c1rr rr00 0000 0000 0000
        //      0rrr r001 00cc c1rr rr00 0000 0000 0000
        // "CLRF",      0xffc7cfff, 0x7907c000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(3,19),
        // "CLRF",      0xffc7cfff, 0x7907c000, ZIP_REGFIELD(27), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(3,19),
        // CLR -- a LDI of zero
        // CLR -- a LDI of zero
        // LDI  1xxx.xxxx.xxxx.xxxx.xxrr.rroo.ooo.iiiii -> 1rrr r100 1xcc ciii ii
        // LDI  1xxx.xxxx.xxxx.xxxx.xxrr.rroo.ooo.iiiii -> 1rrr r100 1xcc ciii ii
        "CLR",  0x800003ff, 0x80000000, ZIP_REGFIELD(10) ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        // JMP  1xxx -- xx11.1101.1111.rrrr (Mov to PC)
        // JMP  1xxx -- xx11.1101.1111.rrrr
        "JMP",  0x80203ff0, 0x80003df0, ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_REGFIELD(0), ZIP_OPUNUSED, ZIP_OPUNUSED,
        "JMP",  0x80203ff0, 0x80003df0, ZIP_REGFIELD(10) ZIP_OPUNUSED, ZIP_REGFIELD(0), ZIP_OPUNUSED, ZIP_OPUNUSED,
        // Conditional jump, still move to PC at issue
        "JMP",  0x80203ff0, 0x80203df0, ZIP_REGFIELD(10) ZIP_OPUNUSED, ZIP_REGFIELD(0), ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        "JMP",  0x80203ff0, 0x80203df0, ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_REGFIELD(0), ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        //
        //
        // XOR  1xxx -- xx00.1000.1111  -> 1rrr r001 00cc c011 11
        // XOR  1xxx -- xx00.1000.1111  -> 1rrr r001 00cc c011 11
        "NOT",  0x802003ff, 0x8000008f, ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        "NOT",  0x802003ff, 0x8000008f, ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        "NOT",  0x802003ff, 0x8020008f, ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        "NOT",  0x802003ff, 0x8020008f, ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        // General instructions, bottom half
        // General instructions, bottom half
Line 461... Line 465...
        "DIVS", 0x802003f0, 0x802002b0, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_REGFIELD(0), ZIP_OPUNUSED, ZIP_OPUNUSED,
        "DIVS", 0x802003f0, 0x802002b0, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_REGFIELD(0), ZIP_OPUNUSED, ZIP_OPUNUSED,
        //
        //
        "CLR",  0x802003df, 0x800002c0, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        "CLR",  0x802003df, 0x800002c0, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        "CLR",  0x802003df, 0x802002c0, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        "CLR",  0x802003df, 0x802002c0, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_BITFIELD(2,19),
        "LDI",  0x802003c0, 0x800002c0, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_IMMFIELD(5,0), ZIP_OPUNUSED,
        "LDI",  0x802003c0, 0x800002c0, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_IMMFIELD(5,0), ZIP_OPUNUSED,
        "LDI",  0x802003d0, 0x802002c0, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_IMMFIELD(5,0), ZIP_BITFIELD(2,19),
        "LDI",  0x802003c0, 0x802002c0, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_IMMFIELD(5,0), ZIP_BITFIELD(2,19),
        //
        //
        "NOOP", 0x80003bf0, 0x80003b00, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        "NOOP", 0x80003bf0, 0x80003b00, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED, ZIP_OPUNUSED,
        //
        //
        "BRK",  0x80003bf0, 0x80003b20, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_IMMFIELD(4,0), ZIP_OPUNUSED,
        "BRK",  0x80003bf0, 0x80003b20, ZIP_REGFIELD(10), ZIP_REGFIELD(10), ZIP_OPUNUSED, ZIP_IMMFIELD(4,0), ZIP_OPUNUSED,
        //
        //
Line 564... Line 568...
 
 
                                        imv = getbits(ins, listp[i].s_i);
                                        imv = getbits(ins, listp[i].s_i);
                                        if ((imv != 0)||(listp[i].s_rb == ZIP_OPUNUSED))
                                        if ((imv != 0)||(listp[i].s_rb == ZIP_OPUNUSED))
                                                sprintf(&line[strlen(line)],
                                                sprintf(&line[strlen(line)],
                                                        "$%d%s", imv,
                                                        "$%d%s", imv,
                                                        ((!memop)&&(listp[i].s_rb!=OPUNUSED))?"+":"");
                                                        ((!memop)&&(listp[i].s_rb!=ZIP_OPUNUSED))?"+":"");
                                } if (listp[i].s_rb != ZIP_OPUNUSED) {
                                } if (listp[i].s_rb != ZIP_OPUNUSED) {
                                        int rb = getbits(ins, listp[i].s_rb);
                                        int rb = getbits(ins, listp[i].s_rb);
                                        if (memop)
                                        if (memop)
                                                sprintf(&line[strlen(line)],
                                                sprintf(&line[strlen(line)],
                                                        "(%s)", zop_regstr[rb]);
                                                        "(%s)", zop_regstr[rb]);

powered by: WebSVN 2.1.0

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