Latest P2 Instruction Set (as at 22 Nov 2013)
Cluso99
Posts: 18,069
I have been doing some work related to the last posted instruction set. I know there may still be some changes, but I though I would post how I have broken this set up into blocks.
Opcodes 0000000-0111111:
Opcodes 0000000-0111111:
[TABLE="width: 525"] [TR] [TD]ZCWS[/TD] [TD]0000000[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]RDBYTE[/TD] [TD]D,[#]S/PTRx[/TD] [/TR] [TR] [TD]ZCWS[/TD] [TD]0000001[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]RDBYTEC[/TD] [TD]D,[#]S/PTRx[/TD] [/TR] [TR] [TD]ZCWS[/TD] [TD]0000010[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]RDWORD[/TD] [TD]D,[#]S/PTRx[/TD] [/TR] [TR] [TD]ZCWS[/TD] [TD]0000011[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]RDWORDC[/TD] [TD]D,[#]S/PTRx[/TD] [/TR] [TR] [TD]ZCWS[/TD] [TD]0000100[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]RDLONG[/TD] [TD]D,[#]S/PTRx[/TD] [/TR] [TR] [TD]ZCWS[/TD] [TD]0000101[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]RDLONGC[/TD] [TD]D,[#]S/PTRx[/TD] [/TR] [TR] [TD]ZCWS[/TD] [TD]0000110[/TD] [TD]ZC[/TD] [TD]I[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ZCMS[/TD] [TD]0110100[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]MIN[/TD] [TD]D,[#]S[/TD] [/TR] [TR] [TD]ZCMS[/TD] [TD]0110101[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]MAX[/TD] [TD]D,[#]S[/TD] [/TR] [TR] [TD]ZCMS[/TD] [TD]0110110[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]MINS[/TD] [TD]D,[#]S[/TD] [/TR] [TR] [TD]ZCMS[/TD] [TD]0110111[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]MAXS[/TD] [TD]D,[#]S[/TD] [/TR] [TR] [TD]ZCMS[/TD] [TD]0111000[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]ADDABS[/TD] [TD]D,[#]S[/TD] [/TR] [TR] [TD]ZCMS[/TD] [TD]0111001[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]SUBABS[/TD] [TD]D,[#]S[/TD] [/TR] [TR] [TD]ZCMS[/TD] [TD]0111010[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]INCMOD[/TD] [TD]D,[#]S[/TD] [/TR] [TR] [TD]ZCMS[/TD] [TD]0111011[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]DECMOD[/TD] [TD]D,[#]S[/TD] [/TR] [TR] [TD]ZCMS[/TD] [TD]0111100[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]CMPSUB[/TD] [TD]D,[#]S[/TD] [/TR] [TR] [TD]ZCMS[/TD] [TD]0111101[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]SUBR[/TD] [TD]D,[#]S[/TD] [/TR] [TR] [TD]ZCMS[/TD] [TD]0111110[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]MUL[/TD] [TD]D,[#]S[/TD] [/TR] [TR] [TD]ZCMS[/TD] [TD]0111111[/TD] [TD]ZC[/TD] [TD]I[/TD] [TD]CCCC[/TD] [TD]DDDDDDDDD[/TD] [TD]SSSSSSSSS[/TD] [TD]SCL[/TD] [TD]D,[#]S[/TD] [/TR] [/TABLE]
Comments
I wondered if the second group (opcodes 1000000-1111110) might be rearranged into blocks of similar operand types, with those of the same type as the first group (opcodes 0xxxxxx) being first (as a continuation from the first group) ?
Likewise, I wondered if the third group (opcodes 1111111 using sssssssss as a sub-opcode) might be rearranged into blocks of similar operands ?
In reality, the only point of the above is for visual improvement of the instruction set, and perhaps a slight simplification of compilers and disassemblers.
I also noticed that there are a number of instructions in the third group that have up to 4 variants (SETPORn, CFGDACn, SETPIXn (x8),...) and up to 2-3 variants (ADDPHSn, CLRACCn, ...). I was wondering if those variants that do not utilise Z & C bits could utilise the decode logic for those bits in the second group and might this save gates ???
eg For SETPORn if it used Z & C to decode A/B/C/D (decode gates already in the second set) then they would share the one sub-opcode. Would the saving of these opcodes result in any gate benefit or might the series decode just slow the overall design?
Thanks