打印

求助各位路过的大虾,最好是对51汇编和51的C编译器

[复制链接]
2190|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
mylovetus|  楼主 | 2009-1-7 15:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
下面的代码是两段反汇编.其代码是由C编译器自动产生的.C编译器给他加上的标号我也写在代码段的开头.希望哪位大虾能帮助分析一下,该程序段在C里面怎么表达.(我估计可能是外部数据数组的寻址操作), 谢谢!

?FUNC_ENTER_XDATA:
              ADD   A,10H                        
              XCH   A,DPL                        
              PUSH  ACC                          
              MOV   A,11H                        
              ADDC  A,#0FFH                      
              XCH   A,DPH                        
              PUSH  ACC                          
              MOV   A,10H                        
              CLR   C                            
              SUBB  A,DPL                        
              ADD   A,#0F9H                      
              MOV   R0,A                         
              CLR   A                            
              XCH   A,IE                         
              MOV   11H,DPH                      
              MOV   10H,DPL                      
              XCH   A,IE                         
              MOV   A,R0                         
              XCH   A,R6                         
              MOVX  @DPTR,A                      
              INC   DPTR                         
              MOV   A,20H                        
              MOVX  @DPTR,A                      
              INC   DPTR                         
              MOV   R0,#08H                      
Q0537:        MOV   A,@R0                        
              INC   R0                           
              MOVX  @DPTR,A                      
              INC   DPTR                         
              DJNZ  R6,Q0537                     
              MOV   A,R7                         
              MOVX  @DPTR,A                      
              INC   DPTR                         
              MOV   A,SP                         
              ADD   A,#0FBH                      
              MOV   R0,A                         
              MOV   A,@R0                        
              INC   R0                           
              MOVX  @DPTR,A                      
              INC   DPTR                         
              MOV   A,@R0                        
              INC   R0                           
              MOVX  @DPTR,A                      
              INC   DPTR                         
              INC   R0                           
              INC   R0                           
              MOV   A,@R0                        
              INC   R0                           
              MOVX  @DPTR,A                      
              INC   DPTR                         
              MOV   A,@R0                        
              INC   R0                           
              MOVX  @DPTR,A                      
              INC   DPTR                         
              DEC   SP                           
              DEC   SP                           
              POP   ACC                          
              MOV   R6,A                         
              POP   ACC                          
              MOV   R0,A                         
              DEC   SP                           
              DEC   SP                           
              MOV   A,R0                         
              PUSH  ACC                          
              MOV   A,R6                         
              PUSH  ACC                          
              RET                                

?FUNC_LEAVE_XDATA:
              MOV   DPH,11H                      
              MOV   DPL,10H                      
              MOVX  A,@DPTR                      
              INC   DPTR                         
              MOV   R6,A                         
              MOVX  A,@DPTR                      
              INC   DPTR                         
              MOV   20H,A                        
              MOV   R0,#08H                      
Q057B:        MOVX  A,@DPTR                      
              INC   DPTR                         
              MOV   @R0,A                        
              INC   R0                           
              DJNZ  R7,Q057B                     
              MOVX  A,@DPTR                      
              INC   DPTR                         
              MOV   R7,A                         
              MOVX  A,@DPTR                      
              INC   DPTR                         
              PUSH  ACC                          
              MOVX  A,@DPTR                      
              INC   DPTR                         
              PUSH  ACC                          
              MOVX  A,@DPTR                      
              INC   DPTR                         
              PUSH  ACC                          
              MOVX  A,@DPTR                      
              INC   DPTR                         
              PUSH  ACC                          
              CLR   A                            
              XCH   A,IE                         
              MOV   10H,DPL                      
              MOV   11H,DPH                      
              XCH   A,IE                         
              POP   DPH                          
              POP   DPL                          
              RET                            

相关帖子

沙发
ayb_ice| | 2009-1-7 20:43 | 只看该作者

这么长有点难

不过更多的人没有兴趣.

使用特权

评论回复
板凳
耕在此行| | 2009-1-7 21:28 | 只看该作者

太费劲了

楼主自己花点时间吧.

使用特权

评论回复
地板
ejack| | 2009-1-8 12:12 | 只看该作者

抄板?

使用特权

评论回复
5
ejack| | 2009-1-8 12:14 | 只看该作者

粗看了两眼,好像不是Keil编译生成的,应该是别人自己写的

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

16

主题

171

帖子

0

粉丝