jyrpxj 发表于 2014-8-16 14:22:56

求助:PIC16C5X反汇编出现不明指令008

是这样的,将PIC16C5X的烧录码进行反汇编,出现不明指令。

查官方手册,008这个十六制制码无对应的指令。

请问,这样的不明指令是如何编入芯片内的? 现反汇编是否可用NOP空指令代之?(直接删掉这行是不行的,会导致程序转跳错位。)

猜测:原工程师编好程序后,在无关处加入NOP(即十六进制的000),生成HEX文件,然后将这个NOP对应的位置由000改为008,这样别人反汇编习惯性忽略此行(显示为空行),从而再编译无法产生有效HEX?

摘录部分如下:
行号   地址   十六进制码   指令
1169   490   BF1   GOTO 0x1f1                           
1170   491   C88   MOVLW 0x88                           
1171   492   C75   MOVLW 0x75                           
1172   493   080   SUBWF 0, W                           
1173   494   4A6   BCF 0x6, 0x5                           
1174   495   105   IORWF 0x5, W                           
1175   496   008   ;(不明指令)                                       
1176   497   075   CLRF 0x15                              
1177   498   C8D   MOVLW 0x8d                           
1178   499   085   SUBWF 0x5, W                           
1179   49A   005   TRIS 0x5                              
1180   49B   105   IORWF 0x5, W                           
1181   49C   4A6   BCF 0x6, 0x5                           
1182   49D   485   BCF 0x5, 0x4                           
1183   49E   005   TRIS 0x5                              
1184   49F   505   BSF 0x5, 0                           
1185   4A0   008    ;(不明指令)                                       
1186   4A1   4A6   BCF 0x6, 0x5                           
1187   4A2   485   BCF 0x5, 0x4                           
1188   4A3   005   TRIS 0x5                              
1189   4A4   085   SUBWF 0x5, W                           
1190   4A5   008    ;(不明指令)                                       
1191   4A6   683   BTFSC 0x3, 0x4                        
1192   4A7   105   IORWF 0x5, W                           
1193   4A8   085   SUBWF 0x5, W                           
1194   4A9   283   INCF 0x3, W                           
1195   4AA   008    ;(不明指令)                                       
1196   4AB   0F0   DECF 0x10, F                           
1197   4AC   0F7   DECF 0x17, F                           
1198   4AD   041   CLRF 0x1                              
1199   4AE   0F8   DECF 0x18, F                           
1200   4AF   BF8   GOTO 0x1f8                           
1201   4B0   CAF   MOVLW 0xaf                           
1202   4B1   BF7   GOTO 0x1f7                           
1203   4B2   CAD   MOVLW 0xad                           
1204   4B3   008    ;(不明指令)                                       
1205   4B4   0A0   SUBWF 0, F                           
1206   4B5   0F5   DECF 0x15, F                           
1207   4B6   461   BCF 0x1, 0x3                           
1208   4B7   46A   BCF 0xa, 0x3

liufabing 发表于 2014-8-16 16:07:24

没用过PIC,不清楚,有些单片机的表格数据反汇编出来也会出现类似不明指令吧.
有没有可能是表格数据?

alias 发表于 2014-8-16 14:22:57

楼主所贴的反汇编结果,除了行号1170/1171有问题外,不太像是数据资料。

跟据以下文档提示,所有 16C5X 未有使用的指令组合,都会被MCU当作 NOP 指令般来运行。 所以把 008 用 NOP 代替是一样的。

PIC16CXX Instruction Set
               
               The PIC16CXX instruction set consists of
               36 instructions, each a single 14-bit wide
               word.Most instructions operate on a file
               register, f, and the working register, W
               (accumulator).The result can be directed
               either to the file register or the W
               register or to both in the case of some
               instructions.A few instructions operate
               solely on a file register (BSF for
               example).
               
               All instructions execute in a single
               instruction cycle unless otherwise noted.
               Any unused opcode is executed as a NOP.
               The instruction set is highly orthogonal
               and is grouped into three basic
               catagories:
               
               �Byte Oriented operations
               �Bit Oriented Operations
               �Literal and Control Operations

yklstudent 发表于 2014-8-16 16:47:01

这是破解的节奏 好高端

yxylxj 发表于 2014-8-20 11:42:19

有偿 帮我反汇编 一个pic16f76bin文件

jyrpxj 发表于 2014-8-20 12:27:05

yxylxj 发表于 2014-8-20 11:42
有偿 帮我反汇编 一个pic16f76bin文件

这个反汇编没有搞定,把反汇编出来的代码送出,难以看出端倪。可能是原工程师故意放了很多无效或近似无效的指令。
页: [1]
查看完整版本: 求助:PIC16C5X反汇编出现不明指令008