本帖最后由 Jerric 于 2015-3-2 14:34 编辑
原程序被用Keil 封装成 lib库了。 反汇编后得到如下汇编程序。
需要 将下面的程序读懂并写面C 程序。 以下程序调用的子函数也需要一并翻译。
有意向的可具体详细了解。 对熟悉汇编的人来说应该是不难。 价格可了解难度后再谈。
联系QQ : 二二九 二三伍 084
CTK_Init:
C:0x048E 75B100 MOV SELB(0xB1),#0x00
C:0x0491 75B0FF MOV TRISB(0xB0),#0xFF
C:0x0494 75B5FF MOV CTK_CEN1(0xB5),#0xFF
C:0x0497 43B710 ORL CTK_CEN3(0xB7),#0x10
C:0x049A E4 CLR A
C:0x049B F5A4 MOV CEN_ADC(0xA4),A
C:0x049D 75A410 MOV CEN_ADC(0xA4),#0x10
C:0x04A0 752410 MOV AdcMaskSN(0x24),#0x10
C:0x04A3 1206DA LCALL AdcPraRead(C:06DA)
C:0x04A6 75BA06 MOV RESO(0xBA),#0x06
C:0x04A9 E4 CLR A
C:0x04AA F5AA MOV CTK_DS(0xAA),A
C:0x04AC 75A902 MOV CTK_RV(0xA9),#baselineI(0x02)
C:0x04AF 75C201 MOV RB_SW(0xC2),#0x01
C:0x04B2 75B409 MOV PRS_DIV(0xB4),#bI2C_RBuffer(0x09)
C:0x04B5 F5AF MOV DMS(0xAF),A
C:0x04B7 F5C5 MOV PD_CTK(0xC5),A
C:0x04B9 C2AF CLR EA(0xA8.7)
C:0x04BB D2E8 SETB EX2(0xE8.0)
C:0x04BD C2F8 CLR PX2(0xF8.0)
C:0x04BF D2AF SETB EA(0xA8.7)
C:0x04C1 F51A MOV 0x1A,A
C:0x04C3 7426 MOV A,#didAdjustedIREF(0x26)
C:0x04C5 251A ADD A,0x1A
C:0x04C7 F582 MOV DPL(0x82),A
C:0x04C9 E4 CLR A
C:0x04CA 3400 ADDC A,#0x00
C:0x04CC F583 MOV DPH(0x83),A
C:0x04CE 7407 MOV A,#0x07
C:0x04D0 F0 MOVX @DPTR,A
C:0x04D1 742F MOV A,#didAdjustedMIR(0x2F)
C:0x04D3 251A ADD A,0x1A
C:0x04D5 F582 MOV DPL(0x82),A
C:0x04D7 E4 CLR A
C:0x04D8 3400 ADDC A,#0x00
C:0x04DA F583 MOV DPH(0x83),A
C:0x04DC 74FF MOV A,#0xFF
C:0x04DE F0 MOVX @DPTR,A
C:0x04DF 051A INC 0x1A
C:0x04E1 E51A MOV A,0x1A
C:0x04E3 B409DD CJNE A,#bI2C_RBuffer(0x09),C:04C3
C:0x04E6 53B9FD ANL CTK_CTRL(0xB9),#0xFD
C:0x04E9 E4 CLR A
C:0x04EA 782D MOV R0,#0x2D
C:0x04EC F6 MOV @R0,A
C:0x04ED 752CFF MOV 0x2C,#0xFF
C:0x04F0 F52B MOV 0x2B,A
C:0x04F2 752A10 MOV 0x2A,#0x10
C:0x04F5 F529 MOV keysMaskSN(0x29),A
C:0x04F7 1207CE LCALL SetAccessIndexes(C:07CE)
C:0x04FA E52C MOV A,0x2C
C:0x04FC 5401 ANL A,#0x01
C:0x04FE FF MOV R7,A
C:0x04FF E4 CLR A
C:0x0500 FE MOV R6,A
C:0x0501 FD MOV R5,A
C:0x0502 FC MOV R4,A
C:0x0503 EF MOV A,R7
C:0x0504 7005 JNZ C:050B
C:0x0506 12053B LCALL SensorFindNext(C:053B)
C:0x0509 8007 SJMP C:0512
C:0x050B 900A02 MOV DPTR,#0x0A02
C:0x050E E4 CLR A
C:0x050F 93 MOVC A,@A+DPTR
C:0x0510 F5AB MOV CTK_ADDR(0xAB),A
C:0x0512 D202 SETB 0x20.2
C:0x0514 751A04 MOV 0x1A,#0x04
C:0x0517 800F SJMP C:0528
C:0x0519 E51A MOV A,0x1A
C:0x051B 6010 JZ C:052D
C:0x051D 3001F9 JNB aCycleScanDone(0x20.1),C:0519
C:0x0520 151A DEC 0x1A
C:0x0522 C201 CLR aCycleScanDone(0x20.1)
C:0x0524 E51A MOV A,0x1A
C:0x0526 60F1 JZ C:0519
C:0x0528 43B903 ORL CTK_CTRL(0xB9),#0x03
C:0x052B 80EC SJMP C:0519
C:0x052D 1203D8 LCALL CurrentSourceInit(C:03D8)
C:0x0530 120A3C LCALL CTK_Pause(C:0A3C)
C:0x0533 12096B LCALL BaselineInit(C:096B)
C:0x0536 C202 CLR 0x20.2
C:0x0538 020A33 LJMP CTK_Continue(C:0A33)
|