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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [sw/] [zasm/] [zopcodes.cpp] - Diff between revs 51 and 69

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

Rev 51 Rev 69
Line 8... Line 8...
//              of the various Zip Assembly opcodes.  The primary function
//              of the various Zip Assembly opcodes.  The primary function
//              of this file is the zipi_to_string, or Zip Instruction to
//              of this file is the zipi_to_string, or Zip Instruction to
//              string (disassemble) conversion.
//              string (disassemble) conversion.
//
//
// Creator:     Dan Gisselquist, Ph.D.
// Creator:     Dan Gisselquist, Ph.D.
//              Gisselquist Tecnology, LLC
//              Gisselquist Technology, LLC
//
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
//
// Copyright (C) 2015, Gisselquist Technology, LLC
// Copyright (C) 2015, Gisselquist Technology, LLC
//
//
Line 59... Line 59...
        "sR8", "sR9", "sR10","sR11",
        "sR8", "sR9", "sR10","sR11",
        "sR12","sSP", "sCC", "sPC"
        "sR12","sSP", "sCC", "sPC"
};
};
 
 
const   char    *zop_ccstr[] = {
const   char    *zop_ccstr[] = {
        "", ".Z", ".NE", ".GE", ".GT", ".LT", ".C", ".V"
        "", ".LT", ".Z", ".NZ", ".GT", ".GE", ".C", ".V"
};
};
 
 
const ZOPCODE   zoplist[] = {
const ZOPCODE   zoplist[] = {
        // Special case instructions.  These are general instructions, but with
        // Special case instructions.  These are general instructions, but with
        // special opcodes
        // special opcodes
        // Conditional branches
        // Conditional branches
        "BUSY", 0xff1fffff, 0x2f0f7fff, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        //      0.1111.0111.ccc.0.111.10iiiii--
        "BRA",  0xffff8000, 0x2f0f0000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(15,0), OPUNUSED,
        //      0111 1011 11cc c011 110i iiii iiii iiii
        "BRZ",  0xffff8000, 0x2f2f0000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(15,0), OPUNUSED,
        "BUSY", 0xffc7ffff, 0x7bc3dfff, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "BNZ",  0xffff8000, 0x2f4f0000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(15,0), OPUNUSED,
        "BRA",  0xffffe000, 0x7bc3c000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
        "BGE",  0xffff8000, 0x2f6f0000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(15,0), OPUNUSED,
        "BLT",  0xffffe000, 0x7bcbc000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
        "BGT",  0xffff8000, 0x2f8f0000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(15,0), OPUNUSED,
        "BRZ",  0xffffe000, 0x7bd3c000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
        "BLT",  0xffff8000, 0x2faf0000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(15,0), OPUNUSED,
        "BNZ",  0xffffe000, 0x7bdbc000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
        "BRC",  0xffff8000, 0x2fcf0000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(15,0), OPUNUSED,
        "BGE",  0xffffe000, 0x7be3c000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
        "BRV",  0xffff8000, 0x2fef0000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(15,0), OPUNUSED,
        "BGT",  0xffffe000, 0x7bebc000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
        // CLR
        "BRC",  0xffffe000, 0x7bf3c000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
        "CLRF", 0xff1f0000, 0xc0100000, REGFIELD(24), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "BRV",  0xffffe000, 0x7bfbc000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
        "CLRF", 0xff1f0000, 0xc1110000, REGFIELD(24), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        // CLRF ... an XOR w/ self instruction
        "CLRF", 0xff1f0000, 0xc2120000, REGFIELD(24), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        //      0.rrrr.00100.ccc.1.rrrr.iiiii---
        "CLRF", 0xff1f0000, 0xc3130000, REGFIELD(24), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        //      0rrr r001 00cc c1rr rr00 0000 0000 0000
        "CLRF", 0xff1f0000, 0xc4140000, REGFIELD(24), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x01040000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLRF", 0xff1f0000, 0xc5150000, REGFIELD(24), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x09044000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLRF", 0xff1f0000, 0xc6160000, REGFIELD(24), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x11048000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLRF", 0xff1f0000, 0xc7170000, REGFIELD(24), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x1904c000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLRF", 0xff1f0000, 0xc8180000, REGFIELD(24), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x21050000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLRF", 0xff1f0000, 0xc9190000, REGFIELD(24), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x29054000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLRF", 0xff1f0000, 0xca1a0000, REGFIELD(24),OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x31058000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLRF", 0xff1f0000, 0xcb1b0000, REGFIELD(24),OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x3905c000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLRF", 0xff1f0000, 0xcc1c0000, REGFIELD(24),OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x41060000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLRF", 0xff1f0000, 0xcd1d0000, REGFIELD(24),OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x49064000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLRF", 0xff1f0000, 0xce1e0000, REGFIELD(24),OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x51068000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLRF", 0xff1f0000, 0xcf1f0000, REGFIELD(24),OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x5906c000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        //
        "CLRF", 0xffc7cfff, 0x61070000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "CLR",  0xf0ffffff, 0x30000000, REGFIELD(24),OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED,
        "CLRF", 0xffc7cfff, 0x69074000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        //
        "CLRF", 0xffc7cfff, 0x71078000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        "HALT", 0xff10007f, 0xbe000010, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "CLRF", 0xffc7cfff, 0x7907c000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
 
        // CLR -- a LDI of zero
 
        //      0.rrrr.1011.iiiiiii--
 
        //      0rrr r101 1...
 
        "CLR",  0x878fffff, 0x05800000, REGFIELD(27),OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED,
 
        // HALT
 
        //      0.1110.00011.ccc.0.0000000000010
 
        //      0111.0000.11cc.c000.0000.0000.0000.0010
 
        "HALT", 0xffc7ffff, 0x70c00010, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        // The "wait" instruction is identical, with the only difference being
        // The "wait" instruction is identical, with the only difference being
        // the interrrupt context of the processor.  Hence we allow both 
        // the interrrupt context of the processor.  Well, almost.  To
        // instructions here.
        // facilitate waits from supervisor mode, the wait instruction
        "WAIT", 0xff10007f, 0xbe000010, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        // explicitly forces the CPU into user mode.
 
        "WAIT", 0xffc7ffff, 0x70c00030, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        //
        //
        "INT",  0xff10007f, 0x9e00005f, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        // "INT",       0xff10007f, 0x9e00005f, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        // Return to user space
        // Return to user space
        "RTU",  0xff10007f, 0xbe000020, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "RTU",  0xffc7ffff, 0x70c00020, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        // JMP (possibly a conditional jump, if not covered by branches above)
        // JMP (possibly a conditional jump, if not covered by branches above)
        "JMP",  0xff108000, 0x2f000000, OPUNUSED,OPUNUSED, REGFIELD(16), IMMFIELD(15,0), BITFIELD(3,21),
        // 0.1111.01111.ccc.a.rrrr.biiiiiiiiiiiiiiii
        "JMP",  0xff108000, 0x2f008000, OPUNUSED,OPUNUSED, URGFIELD(16), IMMFIELD(15,0), BITFIELD(3,21),
        // 0111.1011.11cc.c0rr.rrbi.iiii.iiii.iiii
        "LJMP", 0xff100000, 0xaf000000, OPUNUSED,OPUNUSED, OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
        "JMP",  0xffc42000, 0x7bc00000, OPUNUSED,OPUNUSED, REGFIELD(14), IMMFIELD(13,0), BITFIELD(3,19),
        // NOT
        "JMP",  0xffc42000, 0x7bc02000, OPUNUSED,OPUNUSED, URGFIELD(14), IMMFIELD(13,0), BITFIELD(3,19),
        "NOT",  0xf01fffff, 0xc00fffff, REGFIELD(24), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        // 0.1111.1001.ii.iiii.iiii.iiii.iiii.iiii.iiii
 
        // 0111.1100.1iii.iiii.iiii.iiii.iiii.iiii
 
        "JMP",  0xff800000, 0x7c800000, REGFIELD(27),OPUNUSED, OPUNUSED, IMMFIELD(23,0), OPUNUSED,
 
        // 0.1111.00010.ccc0.iiiii.iiii.iiii.iiii.iiii
 
        // 0111.1000.10cc.c0ii.iiii.iiii.iiii.iiii
 
        "LJMP", 0xffc40000, 0x78800000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        // 0.1111.10010.000.1.1111.000000000000000
 
        // 0111.1100.10cc.c111.11ii.iiii.iiii.iiii
 
        "FJMP", 0xffc7ffff, 0x7c87c000, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
 
        // NOT : XOR w/ -1
 
        //      0.rrrr.00100.ccc.0111.11111111111
 
        //      0rrr.r001.00cc.c011.f.f.f.f
 
        "NOT",  0x87c7ffff, 0x0103ffff, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
        // General instructions
        // General instructions
        "CMP",  0xf0100000, 0x00000000, OPUNUSED, REGFIELD(24), OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
        // 0rrr.rooo.oocc.cxrr.rrii.iiii.iiii.iiii
        "CMP",  0xf0100000, 0x00100000, OPUNUSED, REGFIELD(24), REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
        "SUB",  0x87c40000, 0x00000000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
        "TST",  0xf0100000, 0x10000000, OPUNUSED, REGFIELD(24), OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
        "SUB",  0x87c40000, 0x00040000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
        "TST",  0xf0100000, 0x10100000, OPUNUSED, REGFIELD(24), REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
        //
 
        "AND",  0x87c40000, 0x00400000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "AND",  0x87c40000, 0x00440000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "ADD",  0x87c40000, 0x00800000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "ADD",  0x87c40000, 0x00840000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "OR",   0x87c40000, 0x00c00000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "OR",   0x87c40000, 0x00c40000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "XOR",  0x87c40000, 0x01000000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "XOR",  0x87c40000, 0x01040000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "LSR",  0x87c40000, 0x01400000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "LSR",  0x87c40000, 0x01440000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "LSL",  0x87c40000, 0x01800000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "LSL",  0x87c40000, 0x01840000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "ASR",  0x87c40000, 0x01c00000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "ASR",  0x87c40000, 0x01c40000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "LDIHI",0x87c40000, 0x02000000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "LDIHI",0x87c40000, 0x02040000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "LDILO",0x87c40000, 0x02400000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "LDILO",0x87c40000, 0x02440000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "MPYU", 0x87c40000, 0x02800000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "MPYU", 0x87c40000, 0x02840000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "MPYS", 0x87c40000, 0x02c00000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "MPYS", 0x87c40000, 0x02c40000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "BREV", 0x87c40000, 0x03000000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "BREV", 0x87c40000, 0x03040000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "POPC", 0x87c40000, 0x03400000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "POPC", 0x87c40000, 0x03440000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "ROL",  0x87c40000, 0x03800000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "ROL",  0x87c40000, 0x03840000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
        // map bit = 1 (interrupts enabled) specifies user reg
        // map bit = 1 (interrupts enabled) specifies user reg
        "MOV",  0xf0108000, 0x20000000, REGFIELD(24),OPUNUSED, REGFIELD(16), IMMFIELD(15,0), BITFIELD(3,21),
        // 0rrr.rooo.oocc.cxrr.rrxi.iiii.iiii.iiii
        "MOV",  0xf0108000, 0x20100000, URGFIELD(24),OPUNUSED, REGFIELD(16), IMMFIELD(15,0), BITFIELD(3,21),
        "MOV",  0x87c42000, 0x03c00000, REGFIELD(27),OPUNUSED, REGFIELD(14), IMMFIELD(13,0), BITFIELD(3,19),
        "MOV",  0xf0108000, 0x20008000, REGFIELD(24),OPUNUSED, URGFIELD(16), IMMFIELD(15,0), BITFIELD(3,21),
        "MOV",  0x87c42000, 0x03c40000, URGFIELD(27),OPUNUSED, REGFIELD(14), IMMFIELD(13,0), BITFIELD(3,19),
        "MOV",  0xf0108000, 0x20108000, URGFIELD(24),OPUNUSED, URGFIELD(16), IMMFIELD(15,0), BITFIELD(3,21),
        "MOV",  0x87c42000, 0x03c02000, REGFIELD(27),OPUNUSED, URGFIELD(14), IMMFIELD(13,0), BITFIELD(3,19),
 
        "MOV",  0x87c42000, 0x03c42000, URGFIELD(27),OPUNUSED, URGFIELD(14), IMMFIELD(13,0), BITFIELD(3,19),
 
        //
 
        "CMP",  0x87c40000, 0x04000000, OPUNUSED, REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "CMP",  0x87c40000, 0x04040000, OPUNUSED, REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        "TST",  0x87c40000, 0x04400000, OPUNUSED, REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "TST",  0x87c40000, 0x04440000, OPUNUSED, REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        // 0rrr.r101.1
 
        "LDI",  0x87800000, 0x05800000, REGFIELD(27),OPUNUSED, OPUNUSED, IMMFIELD(23,0), OPUNUSED,
 
        //
 
        "NOOP",  0xffffffff, 0x76000000, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED,
 
        "BRK",   0xffffffff, 0x76400000, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED,
 
        "LOCK",  0xffffffff, 0x76800000, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED,
 
        //
 
        //
 
        // LOD: 0rrr.r100.10cc.cxrr.rrii.iiii.iiii.iiii
 
        "LOD",  0x87c40000, 0x04800000, REGFIELD(27), OPUNUSED, OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "LOD",  0x87c40000, 0x04840000, REGFIELD(27), OPUNUSED, REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        "STO",  0x87c40000, 0x04c00000, OPUNUSED, REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "STO",  0x87c40000, 0x04c40000, OPUNUSED, REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        // 0rrr.r101.1dcc.cxrr.rrii.iiii.iiii.iiii
 
        "DIVU", 0x87c40000, 0x05000000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "DIVU", 0x87c40000, 0x05040000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        "DIVS", 0x87c40000, 0x05400000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "DIVS", 0x87c40000, 0x05440000, REGFIELD(27), REGFIELD(27), REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        // 0rrr.r11f.ffcc.cxrr.rrii.iiii.iiii.iiii
 
        "FPADD",0x87c43fff, 0x06040000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(3,19),
 
        "FPSUB",0x87c43fff, 0x06440000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(3,19),
 
        "FPMPY",0x87c43fff, 0x06840000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(3,19),
 
        "FPDIV",0x87c43fff, 0x06c40000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(3,19),
 
        "FPCVT",0x87c40000, 0x07000000, REGFIELD(27), OPUNUSED, OPUNUSED, IMMFIELD(18,0), BITFIELD(3,19),
 
        "FPCVT",0x87c40000, 0x07040000, REGFIELD(27), OPUNUSED, REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        "FPINT",0x87c40000, 0x07440000, REGFIELD(27), OPUNUSED, REGFIELD(14), IMMFIELD(14,0), BITFIELD(3,19),
 
        //
 
        //
 
        //
 
        //
 
        //
 
        //      16-bit instructions, high side
 
        //
 
        // LDI  1.rrrr.1001x.ccc.iiiii  -> 1rrr r100 1xcc ciii ii
 
        "CLR",  0x87c7c000, 0x84800000, REGFIELD(27),OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED,
 
        // JMP  1.1111.01111.ccc.1rrrr  -> 1111 1011 11cc c1rr rr
 
        "JMP",  0xffc40000, 0xfbc40000, REGFIELD(27),OPUNUSED, REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        // XOR  1.rrrr.00100.ccc.01111  -> 1rrr r001 00cc c011 11
 
        "NOT",  0x87c7c000, 0x8103c000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(2,19),
 
        // General instructions, top half
 
        // 1rrr.rooo.oocc.cxrr.rr
 
        "SUB",  0x87c40000, 0x80000000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
 
        "SUB",  0x87c40000, 0x80040000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "AND",  0x87c40000, 0x80400000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
 
        "AND",  0x87c40000, 0x80440000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "ADD",  0x87c40000, 0x80800000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
 
        "ADD",  0x87c40000, 0x80840000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "OR",   0x87c40000, 0x80c00000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
 
        "OR",   0x87c40000, 0x80c40000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        //
        //
        "LDI",  0xf0000000, 0x30000000, REGFIELD(24),OPUNUSED, OPUNUSED, IMMFIELD(24,0), OPUNUSED,
        "XOR",  0x87c40000, 0x81000000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
 
        "XOR",  0x87c40000, 0x81040000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        //
        //
        "NOOP",  0xffffffff, 0x4e000000, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED,
        "LSR",  0x87c40000, 0x81400000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
        "BRK",   0xffffffff, 0x4e000001, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED,
        "LSR",  0x87c40000, 0x81440000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        //
        //
        "LDILO",0xff100000, 0x4f000000, REGFIELD(16),OPUNUSED, OPUNUSED, IMMFIELD(16,0), BITFIELD(3,21),
        "LSL",  0x87c40000, 0x81800000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
        "LDIHI",0xff100000, 0x4f100000, REGFIELD(16),OPUNUSED, OPUNUSED, IMMFIELD(16,0), BITFIELD(3,21),
        "LSL",  0x87c40000, 0x81840000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        //
        //
        "MPYU", 0xf01f0000, 0x400f0000, REGFIELD(24), REGFIELD(24), OPUNUSED, IMMFIELD(15,0), BITFIELD(3,21),
        "ASR",  0x87c40000, 0x81c00000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
        "MPYU", 0xf0100000, 0x40000000, REGFIELD(24), REGFIELD(24), REGFIELD(16), IMMFIELD(15,0), BITFIELD(3,21),
        "ASR",  0x87c40000, 0x81c40000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        "MPYS", 0xf01f0000, 0x401f0000, REGFIELD(24), REGFIELD(24), OPUNUSED, IMMFIELD(15,0), BITFIELD(3,21),
 
        "MPYS", 0xf0100000, 0x40100000, REGFIELD(24), REGFIELD(24), REGFIELD(16), IMMFIELD(15,0), BITFIELD(3,21),
 
        //
        //
        "ROL",  0xf0100000, 0x50000000, REGFIELD(24), REGFIELD(24), OPUNUSED, IMMFIELD(5,0), BITFIELD(3,21),
        "LDIHI",0x87c40000, 0x82000000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(5,14), BITFIELD(2,19),
        "ROL",  0xf0100000, 0x50100000, REGFIELD(24), REGFIELD(24), REGFIELD(16), IMMFIELD(5,0), BITFIELD(3,21),
        "LDILO",0x87c40000, 0x82400000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(5,14), BITFIELD(2,19),
        //
        //
        "RETN", 0xff1fffff, 0x6f1d0001, OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,21),
        "MPYU", 0x87c40000, 0x82800000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
        "LOD",  0xf0100000, 0x60000000, REGFIELD(24), OPUNUSED, OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
        "MPYU", 0x87c40000, 0x82840000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        "LOD",  0xf0100000, 0x60100000, REGFIELD(24), OPUNUSED, REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
 
        //
        //
        "STO",  0xf0100000, 0x70000000, OPUNUSED, REGFIELD(24), OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
        "MPYS", 0x87c40000, 0x82c00000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
        "STO",  0xf0100000, 0x70100000, OPUNUSED, REGFIELD(24), REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
        "MPYS", 0x87c40000, 0x82c40000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        //
        //
        "SUB",  0xf0100000, 0x80000000, REGFIELD(24), REGFIELD(24), OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
        "BREV", 0x87c40000, 0x83000000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
        "SUB",  0xf0100000, 0x80100000, REGFIELD(24), REGFIELD(24), REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
        "BREV", 0x87c40000, 0x83040000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        //
        //
        "AND",  0xf0100000, 0x90000000, REGFIELD(24), REGFIELD(24), OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
        "POPC", 0x87c40000, 0x83400000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
        "AND",  0xf0100000, 0x90100000, REGFIELD(24), REGFIELD(24), REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
        "POPC", 0x87c40000, 0x83440000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        //
        //
        "ADD",  0xf0100000, 0xa0000000, REGFIELD(24), REGFIELD(24), OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
        "ROL",  0x87c40000, 0x83800000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
        "ADD",  0xf0100000, 0xa0100000, REGFIELD(24), REGFIELD(24), REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
        "ROL",  0x87c40000, 0x83840000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        //
        //
        "OR",   0xf0100000, 0xb0000000, REGFIELD(24), REGFIELD(24), OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
        "MOV",  0x87c40000, 0x83c40000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        "OR",   0xf0100000, 0xb0100000, REGFIELD(24), REGFIELD(24), REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
 
        //
        //
        "XOR",  0xf0100000, 0xc0000000, REGFIELD(24), REGFIELD(24), OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
        "CMP",  0x87c40000, 0x84000000, OPUNUSED, REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
        "XOR",  0xf0100000, 0xc0100000, REGFIELD(24), REGFIELD(24), REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
        "CMP",  0x87c40000, 0x84040000, OPUNUSED, REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        //
        //
        "LSL",  0xf0100000, 0xd0000000, REGFIELD(24), REGFIELD(24), OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
        "TST",  0x87c40000, 0x84400000, OPUNUSED, REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
        "LSL",  0xf0100000, 0xd0100000, REGFIELD(24), REGFIELD(24), REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
        "TST",  0x87c40000, 0x84440000, OPUNUSED, REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "LOD",  0x87c40000, 0x84840000, REGFIELD(27), OPUNUSED, REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "STO",  0x87c40000, 0x84c40000, REGFIELD(27), OPUNUSED, REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "DIVU", 0x87c40000, 0x85000000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
 
        "DIVU", 0x87c40000, 0x85040000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "DIVS", 0x87c40000, 0x85400000, REGFIELD(27), REGFIELD(27), OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
 
        "DIVS", 0x87c40000, 0x85440000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "LDI",  0x87c40000, 0x85800000, REGFIELD(27), OPUNUSED, OPUNUSED, IMMFIELD(5,14), BITFIELD(2,19),
 
        //
 
        "NOOP", 0xf7c00000, 0xf6000000, REGFIELD(27), OPUNUSED, OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
 
        //
 
        "BRK",  0xf7c00000, 0xf6400000, REGFIELD(27), OPUNUSED, OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
 
        //
 
        "LOCK", 0xf7c00000, 0xf6800000, REGFIELD(27), OPUNUSED, OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
 
        //
 
        //
 
        "FPADD",0x87c40000, 0x86040000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "FPSUB",0x87c40000, 0x86440000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "FPMUL",0x87c40000, 0x86840000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "FPDIV",0x87c40000, 0x86c40000, REGFIELD(27), REGFIELD(27), REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "FPCVT",0x87c40000, 0x87000000, REGFIELD(27), OPUNUSED, OPUNUSED, IMMFIELD(4,14), BITFIELD(2,19),
 
        "FPCVT",0x87c40000, 0x87040000, REGFIELD(27), OPUNUSED, REGFIELD(14), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "FPINT",0x87c40000, 0x87440000, REGFIELD(27), OPUNUSED, REGFIELD(14), OPUNUSED, BITFIELD(2,19),
        //
        //
        "ASR",  0xf0100000, 0xe0000000, REGFIELD(24), REGFIELD(24), OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
 
        "ASR",  0xf0100000, 0xe0100000, REGFIELD(24), REGFIELD(24), REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
 
        //
        //
        "LSR",  0xf0100000, 0xf0000000, REGFIELD(24), REGFIELD(24), OPUNUSED, IMMFIELD(19,0), BITFIELD(3,21),
 
        "LSR",  0xf0100000, 0xf0100000, REGFIELD(24), REGFIELD(24), REGFIELD(16), IMMFIELD(16,0), BITFIELD(3,21),
 
        // Illegal instruction !!
        // Illegal instruction !!
        "ILL",  0x00000000, 0x00000000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(32,0), OPUNUSED
        "ILL",  0x00000000, 0x00000000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(32,0), OPUNUSED
};
};
 
 
 
const ZOPCODE   zbottomlist[] = {
 
        //
 
        //
 
        //
 
        //      16-bit instructions, low side ... treat these as special
 
        //
 
        //
 
        // Special case instructions.  These are general instructions, but with
 
        // special opcodes
 
        // Conditional branches
 
        //      0.1111.0111.ccc.0.111.10iiiii--
 
        //      0111 1011 11cc c011 110i iiii iiii iiii
 
        // "BRA",  0xffffe000, 0x7bc3c000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
 
        // "BLT",  0xffffe000, 0x7bcbc000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
 
        // "BRZ",  0xffffe000, 0x7bd3c000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
 
        // "BNZ",  0xffffe000, 0x7bdbc000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
 
        // "BGE",  0xffffe000, 0x7be3c000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
 
        // "BGT",  0xffffe000, 0x7bebc000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
 
        // "BRC",  0xffffe000, 0x7bf3c000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
 
        // "BRV",  0xffffe000, 0x7bfbc000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(13,0), OPUNUSED,
 
        //
 
        //
 
        // CLRF ... an XOR w/ self instruction
 
        //      0.rrrr.00100.ccc.1.rrrr.iiiii---
 
        //      0rrr r001 00cc c1rr rr00 0000 0000 0000
 
        // "CLRF",      0xffc7cfff, 0x7907c000, REGFIELD(27), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(3,19),
 
        // CLR -- a LDI of zero
 
        // LDI  1xxx.xxxx.xxxx.xxxx.xxrr.rroo.ooo.iiiii -> 1rrr r100 1xcc ciii ii
 
        "CLR",  0x800003ff, 0x80000000, REGFIELD(12),OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED,
 
        // JMP  1xxx -- xx11.1101.1111.rrrr
 
        "JMP",  0x80203ff0, 0x80003df0, REGFIELD(12),OPUNUSED, REGFIELD(0), OPUNUSED, OPUNUSED,
 
        "JMP",  0x80203ff0, 0x80203df0, REGFIELD(12),OPUNUSED, REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        //
 
        // XOR  1xxx -- xx00.1000.1111  -> 1rrr r001 00cc c011 11
 
        "NOT",  0x802003ff, 0x80000080, REGFIELD(12), OPUNUSED, OPUNUSED, OPUNUSED, OPUNUSED,
 
        "NOT",  0x802003ff, 0x80200080, REGFIELD(12), OPUNUSED, OPUNUSED, OPUNUSED, BITFIELD(2,19),
 
        // General instructions, bottom half
 
        // 1xxx -- xxrr.rroo.ooox.rrrr
 
        "SUB",  0x800003f0, 0x80000000, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "SUB",  0x802003f0, 0x80200000, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "SUB",  0x800003f0, 0x80000010, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "SUB",  0x802003f0, 0x80200010, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "AND",  0x800003f0, 0x80000020, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "AND",  0x802003f0, 0x80200020, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "AND",  0x800003f0, 0x80000030, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "AND",  0x802003f0, 0x80200030, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "ADD",  0x800003f0, 0x80000040, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "ADD",  0x802003f0, 0x80200040, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "ADD",  0x800003f0, 0x80000050, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "ADD",  0x802003f0, 0x80200050, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "OR",   0x800003f0, 0x80000060, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "OR",   0x802003f0, 0x80200060, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "OR",   0x800003f0, 0x80000070, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "OR",   0x802003f0, 0x80200070, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "XOR",  0x800003f0, 0x80000080, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "XOR",  0x802003f0, 0x80200080, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "XOR",  0x800003f0, 0x80000090, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "XOR",  0x802003f0, 0x80200090, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "LSR",  0x800003f0, 0x800000a0, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "LSR",  0x802003f0, 0x802000a0, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "LSR",  0x800003f0, 0x800000b0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "LSR",  0x802003f0, 0x802000b0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "LSL",  0x800003f0, 0x800000c0, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "LSL",  0x802003f0, 0x802000c0, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "LSL",  0x800003f0, 0x800000d0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "LSL",  0x802003f0, 0x802000d0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "ASR",  0x800003f0, 0x800000e0, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "ASR",  0x802003f0, 0x802000e0, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "ASR",  0x800003f0, 0x800000f0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "ASR",  0x802003f0, 0x802000f0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "LDIHI",0x800003e0, 0x80000100, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(5,0), BITFIELD(2,19),
 
        "LDIHI",0x802003e0, 0x80200100, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(5,0), OPUNUSED,
 
        //
 
        "LDILO",0x800003e0, 0x80000120, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(5,0), BITFIELD(2,19),
 
        "LDILO",0x802003e0, 0x80200120, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(5,0), OPUNUSED,
 
        //
 
        //
 
        "MPYU", 0x800003f0, 0x80000140, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "MPYU", 0x802003f0, 0x80200140, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "MPYU", 0x800003f0, 0x80000150, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "MPYU", 0x802003f0, 0x80200150, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "MPYS", 0x800003f0, 0x80000160, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "MPYS", 0x802003f0, 0x80200160, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "MPYS", 0x800003f0, 0x80000170, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "MPYS", 0x802003f0, 0x80200170, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "BREV", 0x800003f0, 0x80000180, REGFIELD(12), OPUNUSED, OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "BREV", 0x802003f0, 0x80200180, REGFIELD(12), OPUNUSED, OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "BREV", 0x800003f0, 0x80000190, REGFIELD(12), OPUNUSED, REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "BREV", 0x802003f0, 0x80200190, REGFIELD(12), OPUNUSED, REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "POPC", 0x800003f0, 0x800001a0, REGFIELD(12), OPUNUSED, OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "POPC", 0x802003f0, 0x802001a0, REGFIELD(12), OPUNUSED, OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "POPC", 0x800003f0, 0x800001b0, REGFIELD(12), OPUNUSED, REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "POPC", 0x802003f0, 0x802001b0, REGFIELD(12), OPUNUSED, REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "ROL",  0x800003f0, 0x800001c0, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "ROL",  0x802003f0, 0x802001c0, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "ROL",  0x800003f0, 0x800001d0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "ROL",  0x802003f0, 0x802001d0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "MOV",  0x800003f0, 0x800001f0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "MOV",  0x802003f0, 0x802001f0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "CMP",  0x800003f0, 0x80000200, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "CMP",  0x802003f0, 0x80200200, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "CMP",  0x800003f0, 0x80000210, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "CMP",  0x802003f0, 0x80200210, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "TST",  0x800003f0, 0x80000220, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "TST",  0x802003f0, 0x80200220, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "TST",  0x800003f0, 0x80000230, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "TST",  0x802003f0, 0x80200230, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "LOD",  0x800003f0, 0x80000250, REGFIELD(12), OPUNUSED, REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "LOD",  0x802003f0, 0x80200250, REGFIELD(12), OPUNUSED, REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "STO",  0x800003f0, 0x80000270, OPUNUSED, REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "STO",  0x802003f0, 0x80200270, OPUNUSED, REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "DIVU", 0x800003f0, 0x80000280, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "DIVU", 0x802003f0, 0x80200280, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "DIVU", 0x800003f0, 0x80000290, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "DIVU", 0x802003f0, 0x80200290, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "DIVS", 0x800003f0, 0x800002a0, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "DIVS", 0x802003f0, 0x802002a0, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "DIVS", 0x800003f0, 0x800002b0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        "DIVS", 0x802003f0, 0x802002b0, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        //
 
        "LDI",  0x802003d0, 0x800002c0, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        //
 
        "NOOP", 0x80003bf0, 0x80003b00, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        //
 
        "BRK",  0x80003bf0, 0x80003b20, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        //
 
        "LOCK", 0x80003bf0, 0x80003b40, REGFIELD(12), REGFIELD(12), OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        //
 
        // FPU instructions
 
        //
 
        "FPADD",0x802003f0, 0x80000310, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        "FPADD",0x802003f0, 0x80200310, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "FPSUB",0x802003f0, 0x80000330, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        "FPSUB",0x802003f0, 0x80200330, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "FPMUL",0x802003f0, 0x80000350, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        "FPMUL",0x802003f0, 0x80200350, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        //
 
        "FPDIV",0x802003f0, 0x80000370, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, OPUNUSED,
 
        "FPDIV",0x802003f0, 0x80200370, REGFIELD(12), REGFIELD(12), REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        // Convert to floating point
 
        "FPCVT",0x802003f0, 0x80000380, REGFIELD(12), OPUNUSED, OPUNUSED, IMMFIELD(4,0), OPUNUSED,
 
        "FPCVT",0x802003f0, 0x80200380, REGFIELD(12), OPUNUSED, OPUNUSED, IMMFIELD(4,0), BITFIELD(2,19),
 
        "FPCVT",0x802003f0, 0x80000390, REGFIELD(12), OPUNUSED, REGFIELD(0), OPUNUSED, OPUNUSED,
 
        "FPCVT",0x802003f0, 0x80200390, REGFIELD(12), OPUNUSED, REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        // Convert to integer
 
        "FPINT",0x802003f0, 0x800003b0, REGFIELD(12), OPUNUSED, REGFIELD(0), OPUNUSED, OPUNUSED,
 
        "FPINT",0x802003f0, 0x802003b0, REGFIELD(12), OPUNUSED, REGFIELD(0), OPUNUSED, BITFIELD(2,19),
 
        //
 
        //
 
        // Illegal instruction !!
 
        "ILL",  0x00000000, 0x00000000, OPUNUSED, OPUNUSED, OPUNUSED, IMMFIELD(32,0), OPUNUSED
 
};
 
 
 
 
const int       nzoplist = (sizeof(zoplist)/sizeof(ZOPCODE));
const int       nzoplist = (sizeof(zoplist)/sizeof(ZOPCODE));
 
const int       nzopbottom = (sizeof(zbottomlist)/sizeof(ZOPCODE));
 
 
static  int     getbits(const ZIPI ins, const int which) {
static  int     getbits(const ZIPI ins, const int which) {
        if (which & 0x40000000) {
        if (which & 0x40000000) {
                // printf("SBITS: %08x, %08x = %08lx\n", ins, which,
                // printf("SBITS: %08x, %08x = %08lx\n", ins, which,
                        // sbits(ins>>(which & 0x03f), (which>>8)&0x03f));
                        // sbits(ins>>(which & 0x03f), (which>>8)&0x03f));
Line 186... Line 511...
        } else
        } else
                return which;
                return which;
}
}
 
 
void    zipi_to_string(const ZIPI ins, char *line) {
void    zipi_to_string(const ZIPI ins, char *line) {
        for(int i=0; i<nzoplist; i++)
        for(int i=0; i<nzoplist; i++) {
 
                if (((~zoplist[i].s_mask)&zoplist[i].s_val)!=0) {
 
                        printf("Instruction %d, %s, fails consistency check\n",
 
                                i, zoplist[i].s_opstr);
                assert(((~zoplist[i].s_mask)&zoplist[i].s_val)==0);
                assert(((~zoplist[i].s_mask)&zoplist[i].s_val)==0);
 
                }
 
        }
        for(int i=0; i<nzoplist; i++) {
        for(int i=0; i<nzoplist; i++) {
                // printf("%2d: %6s %08x & %08x == %08x\n",
                // printf("%2d: %6s %08x & %08x == %08x\n",
                        // i, zoplist[i].s_opstr, ins,
                        // i, zoplist[i].s_opstr, ins,
                        // zoplist[i].s_mask, zoplist[i].s_val);
                        // zoplist[i].s_mask, zoplist[i].s_val);
                if ((ins & zoplist[i].s_mask) == zoplist[i].s_val) {
                if ((ins & zoplist[i].s_mask) == zoplist[i].s_val) {

powered by: WebSVN 2.1.0

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