EmbeddedRelated.com
Forums
Memfault Beyond the Launch

undocumented PIC16 opcodes

Started by bruno gavand June 28, 2007
Hi,

I listed 119 undocumented PIC16 opcodes here :
http://www.micro-examples.com/public/microex-navig/doc/087-pic16-secret-opcode.html

Does anybody here ever tried one of them ?

Thanks,

Bruno 

"bruno gavand" <bgavand@club-internet.fr> wrote in message 
news:46843566$0$21151$7a628cd7@news.club-internet.fr...
> I listed 119 undocumented PIC16 opcodes here : > http://www.micro-examples.com/public/microex-navig/doc/087-pic16-secret-opcode.html > Does anybody here ever tried one of them ?
If you'll remember how a CPU works, you won't assume that any of them do anything useful at all. Some of them -- perhaps a great many of them -- are likely to do exactly the same thing as other, documented opcodes. Some will probably do nothing.
bruno gavand wrote:
> Hi, > > I listed 119 undocumented PIC16 opcodes here : > http://www.micro-examples.com/public/microex-navig/doc/087-pic16-secret-opcode.html > > > Does anybody here ever tried one of them ? > > Thanks, > > Bruno
Undocumented opcodes can cause all sorts of problems if you depend on them. -- Many thanks, Don Lancaster voice phone: (928)428-4073 Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552 rss: http://www.tinaja.com/whtnu.xml email: don@tinaja.com Please visit my GURU's LAIR web site at http://www.tinaja.com
Don Lancaster wrote:
> bruno gavand wrote: > >> Hi, >> >> I listed 119 undocumented PIC16 opcodes here : >> http://www.micro-examples.com/public/microex-navig/doc/087-pic16-secret-opcode.html >> >> >> Does anybody here ever tried one of them ? >> >> Thanks, >> >> Bruno > > > Undocumented opcodes can cause all sorts of problems if you depend on them. >
The other thing you get into is that there might be one class of four opcodes, a second of four, a third of one, and a fourth of one. All of which 4-bit more significantly decode. There is no point is exhaustively decoding something that does not need exhaustively decoded. See my own examples at http://www.tinaja.com/glib/numschip.pdf -- Many thanks, Don Lancaster voice phone: (928)428-4073 Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552 rss: http://www.tinaja.com/whtnu.xml email: don@tinaja.com Please visit my GURU's LAIR web site at http://www.tinaja.com
bruno gavand wrote:
> Hi, > > I listed 119 undocumented PIC16 opcodes here : > http://www.micro-examples.com/public/microex-navig/doc/087-pic16-secret-opcode.html > > > Does anybody here ever tried one of them ?
What you have listed are gaps in the Opcode map, that does NOT mean they are undocumented PIC16 opcodes. Most likely, the core will use minimal decoding, and those opcode spaces will simply alias onto existing opcodes. -jg
On Jun 28, 7:18 pm, Jim Granville <no.s...@designtools.maps.co.nz>
wrote:
> bruno gavand wrote: > > Hi, > > > I listed 119 undocumented PIC16 opcodes here : > >http://www.micro-examples.com/public/microex-navig/doc/087-pic16-secr... > > > Does anybody here ever tried one of them ? > > What you have listed are gaps in the Opcode map, that > does NOT mean they are undocumented PIC16 opcodes. > Most likely, the core will use minimal decoding, and > those opcode spaces will simply alias onto existing opcodes.
Actually they may map into strange things that are not useful. Less than full decoding may cause part of one instruction to be done along with part of another. IIRC, the Z80 had several instuctions that would load a value from memory and them completely ignore it. The PIC may do the same sort of thing. In the 8080 there was a 16 bit subtract that almost worked. It didn't borrow correctly. I believe that the entire x86 line has instructions that do trivial operations but take as long as the floating point squareroot instruction. These secret opcodes were included at Microsofts request.
> I believe that the entire x86 line has instructions that do trivial > operations but take as long as the floating point squareroot > instruction. These secret opcodes were included at Microsofts > request.
The x86 line predates Microsoft... you may mean the 386 and its successors. But why?
mc wrote:
>>I believe that the entire x86 line has instructions that do trivial >>operations but take as long as the floating point squareroot >>instruction. These secret opcodes were included at Microsofts >>request. > > > The x86 line predates Microsoft... you may mean the 386 and its successors. > > But why? > >
Already in 80286. Maybe the weirdest is called loadall. It loads all the registers (including memory protection) from a memory block starting at 0x800. I guess that it is for factory testing the memory management without needing to enter the protected mode (which is a one-way operation in -286). At least Intel's RMX uses the instruction in the boot to load memory above 1 MiB. -- Tauno Voipio tauno voipio (at) iki fi
On Jun 29, 6:43 am, MooseFET <kensm...@rahul.net> wrote:
> On Jun 28, 7:18 pm, Jim Granville <no.s...@designtools.maps.co.nz> > wrote: > > > bruno gavand wrote: > > > Hi, > > > > I listed 119 undocumented PIC16 opcodes here : > > >http://www.micro-examples.com/public/microex-navig/doc/087-pic16-secr... > > > > Does anybody here ever tried one of them ? > > > What you have listed are gaps in the Opcode map, that > > does NOT mean they are undocumented PIC16 opcodes. > > Most likely, the core will use minimal decoding, and > > those opcode spaces will simply alias onto existing opcodes. > > Actually they may map into strange things that are not useful. Less > than full decoding may cause part of one instruction to be done along > with part of another. IIRC, the Z80 had several instuctions that > would load a value from memory and them completely ignore it. The PIC > may do the same sort of thing. > > In the 8080 there was a 16 bit subtract that almost worked. It didn't > borrow correctly. > > I believe that the entire x86 line has instructions that do trivial > operations but take as long as the floating point squareroot > instruction. These secret opcodes were included at Microsofts > request.
http://en.wikipedia.org/wiki/Halt_and_Catch_Fire
Jim Granville wrote:

> bruno gavand wrote: > >> Hi, >> >> I listed 119 undocumented PIC16 opcodes here : >> http://www.micro-examples.com/public/microex-navig/doc/087-pic16-secret-opcode.html >> >> >> Does anybody here ever tried one of them ? > > > What you have listed are gaps in the Opcode map, that > does NOT mean they are undocumented PIC16 opcodes. > Most likely, the core will use minimal decoding, and > those opcode spaces will simply alias onto existing opcodes. > -jg >
And if someone really found a secret op code that makes free margaritas or whatever there would be no guarantee that it doesn't disappear some day after the umpteenth production batch. -- Regards, Joerg http://www.analogconsultants.com

Memfault Beyond the Launch