本文包含原理图、PCB、源代码、封装库、中英文PDF等资源
您需要 登录 才可以下载或查看,没有账号?注册会员
×
我是新手,第一次接触单片机,把汇编转成C上手。但是这个部分我实在看不懂,怎么转成C?是神马原理呢???
还望前辈老师们指教啊!!程序有点长,麻烦各位高手帮我看看吧。。真的谢谢了!
RESET:
Q0000: LJMP Q0A75 ; Reset @00h
=======================================
Reset_Entry
Q0A75: MOV R0,#7FH
CLR A
Q0A78: MOV @R0,A
DJNZ R0,Q0A78 ; (0-0x7f) <- 0
MOV SP,#4EH ; SP <- #4Eh
LJMP Q0ABC
Q0A81: LJMP Q08F1 ;系统初始化,执行完往下继续
Q0A84: CLR A
MOVC A,@A+DPTR
INC DPTR
MOV R0,A
Q0A88: CLR A
MOVC A,@A+DPTR
INC DPTR
JC Q0A90
MOV @R0,A
SJMP Q0A91
Q0A90: MOVX @R0,A
Q0A91: INC R0
DJNZ R7,Q0A88
SJMP Q0ABF
Q0A96: CLR A
MOVC A,@A+DPTR
INC DPTR
MOV R0,A
ANL A,#07H
ADD A,#0CH
XCH A,R0
CLR C
RLC A
SWAP A
ANL A,#0FH
ORL A,#20H
XCH A,R0
MOVC A,@A+PC
JC Q0AAE
CPL A
ANL A,@R0
SJMP Q0AAF
Q0AAE: ORL A,@R0
Q0AAF: MOV @R0,A
DJNZ R7,Q0A96
SJMP Q0ABF
DB 01H,02H,04H,08H,10H,20H,40H,80H
Q0ABC: MOV DPTR,#0DD5H
Q0ABF: CLR A
MOV R6,#01H
MOVC A,@A+DPTR
JZ Q0A81
INC DPTR
MOV R7,A
ANL A,#3FH
JNB ACC.5,Q0AD5
ANL A,#1FH
MOV R6,A
CLR A
MOVC A,@A+DPTR
INC DPTR
JZ Q0AD5
INC R6
Q0AD5: XCH A,R7
ANL A,#C0H
ADD A,ACC
JZ Q0A84
JC Q0A96
CLR A
MOVC A,@A+DPTR
INC DPTR
MOV R2,A
CLR A
MOVC A,@A+DPTR
INC DPTR
MOV R0,A
Q0AE6: CLR A
MOVC A,@A+DPTR
INC DPTR
XCH A,R0
XCH A,DPL
XCH A,R0
XCH A,R2
XCH A,DPH
XCH A,R2
MOVX @DPTR,A
INC DPTR
XCH A,R0
XCH A,DPL
XCH A,R0
XCH A,R2
XCH A,DPH
XCH A,R2
Q0AFB: DJNZ R7,Q0AE6
DJNZ R6,Q0AE6
SJMP Q0ABF
[ 此帖被jivshixiangs在2011-03-01 16:27重新编辑 ] |