Back to www.micro-examples.com

Mysterious Opcodes in PIC16 Instruction Set !

This is not a project, but a challenge !

Did you ever have a look at the PIC16 family instruction set ?

Microchip datasheets announce 35 instructions, for sure they are here, but can't we get a little bit much from these PICs ?

It's time to become closer to PIC16 reduced instruction set, to see if we can extend it.

First, get familiar with instruction format : PIC16 family has a 14 bits wide instruction set, with MSBs as opcode and LSBs as sub-opcode or operand.

Here is the link to the "Microchip PICmicro Mid-Range MCU Family Reference Manual" (datasheet DS33023A) :

http://ww1.microchip.com/downloads/en/devicedoc/33023a.pdf

this figure is coming from this manual :

PIC16 Family instruction set format

Microchip Datasheet DS33023A P.526

 Here is the instruction set list sorted by type, you can count once more : 35 official mnemonics.

PIC Official Instruction Set

 Microchip Datasheet DS33023A P.525

Now, we can try to re-arrange the table, and sort it by opcode number.
I wrote the documented opcodes in green, and the undocumented opcodes in red :

PIC Unused Opcodes

We can see immediately that there are holes in the instruction set sequence.
Correct me if I'm wrong, but there may be a total of 119 secret opcodes.
Here is the table of the undocumented opcodes :

Mnemonic,
Operands

Description Cycles 14-bit Instruction Word

Status
Affected

Found out by ..., on ....

??? ??? ??? 00 0000 0000 0001 ??? your name here ???
??? ??? ??? 00 0000 0000 0010 ??? your name here ???
??? ??? ??? 00 0000 0000 0011 ??? your name here ???
??? ??? ??? 00 0000 0000 0100 ??? your name here ???
??? ??? ??? 00 0000 0000 0101 ??? your name here ???
??? ??? ??? 00 0000 0000 0110 ??? your name here ???
??? ??? ??? 00 0000 0000 0111 ??? your name here ???
??? ??? ??? 00 0000 0000 1010 ??? your name here ???
??? ??? ??? 00 0000 0000 1011 ??? your name here ???
??? ??? ??? 00 0000 0000 1100 ??? your name here ???
??? ??? ??? 00 0000 0000 1101 ??? your name here ???
??? ??? ??? 00 0000 0000 1110 ??? your name here ???
??? ??? ??? 00 0000 0000 1111 ??? your name here ???
??? ??? ??? 00 0000 0001 0000 ??? your name here ???
??? ??? ??? 00 0000 0001 0001 ??? your name here ???
??? ??? ??? 00 0000 0001 0010 ??? your name here ???
??? ??? ??? 00 0000 0001 0011 ??? your name here ???
??? ??? ??? 00 0000 0001 0100 ??? your name here ???
??? ??? ??? 00 0000 0001 0101 ??? your name here ???
??? ??? ??? 00 0000 0001 0110 ??? your name here ???
??? ??? ??? 00 0000 0001 0111 ??? your name here ???
??? ??? ??? 00 0000 0001 1000 ??? your name here ???
??? ??? ??? 00 0000 0001 1001 ??? your name here ???
??? ??? ??? 00 0000 0001 1010 ??? your name here ???
??? ??? ??? 00 0000 0001 1011 ??? your name here ???
??? ??? ??? 00 0000 0001 1100 ??? your name here ???
??? ??? ??? 00 0000 0001 1101 ??? your name here ???
??? ??? ??? 00 0000 0001 1110 ??? your name here ???
??? ??? ??? 00 0000 0001 1111 ??? your name here ???
??? ??? ??? 00 0000 0010 0001 ??? your name here ???
??? ??? ??? 00 0000 0010 0010 ??? your name here ???
??? ??? ??? 00 0000 0010 0011 ??? your name here ???
??? ??? ??? 00 0000 0010 0100 ??? your name here ???
??? ??? ??? 00 0000 0010 0101 ??? your name here ???
??? ??? ??? 00 0000 0010 0110 ??? your name here ???
??? ??? ??? 00 0000 0010 0111 ??? your name here ???
??? ??? ??? 00 0000 0010 1000 ??? your name here ???
??? ??? ??? 00 0000 0010 1001 ??? your name here ???
??? ??? ??? 00 0000 0010 1010 ??? your name here ???
??? ??? ??? 00 0000 0010 1011 ??? your name here ???
??? ??? ??? 00 0000 0010 1100 ??? your name here ???
??? ??? ??? 00 0000 0010 1101 ??? your name here ???
??? ??? ??? 00 0000 0010 1110 ??? your name here ???
??? ??? ??? 00 0000 0010 1111 ??? your name here ???
??? ??? ??? 00 0000 0011 0000 ??? your name here ???
??? ??? ??? 00 0000 0011 0001 ??? your name here ???
??? ??? ??? 00 0000 0011 0010 ??? your name here ???
??? ??? ??? 00 0000 0011 0011 ??? your name here ???
??? ??? ??? 00 0000 0011 0100 ??? your name here ???
??? ??? ??? 00 0000 0011 0101 ??? your name here ???
??? ??? ??? 00 0000 0011 0110 ??? your name here ???
??? ??? ??? 00 0000 0011 0111 ??? your name here ???
??? ??? ??? 00 0000 0011 1000 ??? your name here ???
??? ??? ??? 00 0000 0011 1001 ??? your name here ???
??? ??? ??? 00 0000 0011 1010 ??? your name here ???
??? ??? ??? 00 0000 0011 1011 ??? your name here ???
??? ??? ??? 00 0000 0011 1100 ??? your name here ???
??? ??? ??? 00 0000 0011 1101 ??? your name here ???
??? ??? ??? 00 0000 0011 1110 ??? your name here ???
??? ??? ??? 00 0000 0011 1111 ??? your name here ???
??? ??? ??? 00 0000 0100 0001 ??? your name here ???
??? ??? ??? 00 0000 0100 0010 ??? your name here ???
??? ??? ??? 00 0000 0100 0011 ??? your name here ???
??? ??? ??? 00 0000 0100 0100 ??? your name here ???
??? ??? ??? 00 0000 0100 0101 ??? your name here ???
??? ??? ??? 00 0000 0100 0110 ??? your name here ???
??? ??? ??? 00 0000 0100 0111 ??? your name here ???
??? ??? ??? 00 0000 0100 1000 ??? your name here ???
??? ??? ??? 00 0000 0100 1001 ??? your name here ???
??? ??? ??? 00 0000 0100 1010 ??? your name here ???
??? ??? ??? 00 0000 0100 1011 ??? your name here ???
??? ??? ??? 00 0000 0100 1100 ??? your name here ???
??? ??? ??? 00 0000 0100 1101 ??? your name here ???
??? ??? ??? 00 0000 0100 1110 ??? your name here ???
??? ??? ??? 00 0000 0100 1111 ??? your name here ???
??? ??? ??? 00 0000 0101 0000 ??? your name here ???
??? ??? ??? 00 0000 0101 0001 ??? your name here ???
??? ??? ??? 00 0000 0101 0010 ??? your name here ???
??? ??? ??? 00 0000 0101 0011 ??? your name here ???
??? ??? ??? 00 0000 0101 0100 ??? your name here ???
??? ??? ??? 00 0000 0101 0101 ??? your name here ???
??? ??? ??? 00 0000 0101 0110 ??? your name here ???
??? ??? ??? 00 0000 0101 0111 ??? your name here ???
??? ??? ??? 00 0000 0101 1000 ??? your name here ???
??? ??? ??? 00 0000 0101 1001 ??? your name here ???
??? ??? ??? 00 0000 0101 1010 ??? your name here ???
??? ??? ??? 00 0000 0101 1011 ??? your name here ???
??? ??? ??? 00 0000 0101 1100 ??? your name here ???
??? ??? ??? 00 0000 0101 1101 ??? your name here ???
??? ??? ??? 00 0000 0101 1110 ??? your name here ???
??? ??? ??? 00 0000 0101 1111 ??? your name here ???
??? ??? ??? 00 0000 0110 0001 ??? your name here ???
??? ??? ??? 00 0000 0110 0010 ??? your name here ???
??? ??? ??? 00 0000 0110 0101 ??? your name here ???
??? ??? ??? 00 0000 0110 0110 ??? your name here ???
??? ??? ??? 00 0000 0110 0111 ??? your name here ???
??? ??? ??? 00 0000 0110 1000 ??? your name here ???
??? ??? ??? 00 0000 0110 1001 ??? your name here ???
??? ??? ??? 00 0000 0110 1010 ??? your name here ???
??? ??? ??? 00 0000 0110 1011 ??? your name here ???
??? ??? ??? 00 0000 0110 1100 ??? your name here ???
??? ??? ??? 00 0000 0110 1101 ??? your name here ???
??? ??? ??? 00 0000 0110 1110 ??? your name here ???
??? ??? ??? 00 0000 0110 1111 ??? your name here ???
??? ??? ??? 00 0000 0111 0000 ??? your name here ???
??? ??? ??? 00 0000 0111 0001 ??? your name here ???
??? ??? ??? 00 0000 0111 0010 ??? your name here ???
??? ??? ??? 00 0000 0111 0011 ??? your name here ???
??? ??? ??? 00 0000 0111 0100 ??? your name here ???
??? ??? ??? 00 0000 0111 0101 ??? your name here ???
??? ??? ??? 00 0000 0111 0110 ??? your name here ???
??? ??? ??? 00 0000 0111 0111 ??? your name here ???
??? ??? ??? 00 0000 0111 1000 ??? your name here ???
??? ??? ??? 00 0000 0111 1001 ??? your name here ???
??? ??? ??? 00 0000 0111 1010 ??? your name here ???
??? ??? ??? 00 0000 0111 1011 ??? your name here ???
??? ??? ??? 00 0000 0111 1100 ??? your name here ???
??? ??? ??? 00 0000 0111 1101 ??? your name here ???
??? ??? ??? 00 0000 0111 1110 ??? your name here ???
??? ??? ??? 00 0000 0111 1111 ??? your name here ???
??? ??? ??? 11 1011 kkkk kkkk ??? your name here ???

Maybe all of these opcodes are NOPs, or will freeze the MCU but maybe not, and at least we shall know !
Who will try to find out some of them ?

If you have some ideas, please report them to my forum
If you help me to fill this table, your name will be added to the hall of fame.

Thanks a lot, and enjoy the treasure hunt !

Bruno