?PR?DELAY30US SEGMENT CODE
PUBLIC DELAY30US
RSEG ?PR?DELAY30US
; abc XDATA 0A00H
;35.8US
DELAY30US:
PUSH 05H ;2
MOV r5,#50 ;25
DE30S1:
DJNZ r5,DE30S1 ;2*14=28
POP 05h ;2
RET
;******************************************************************
?PR?DELAY10US SEGMENT CODE
PUBLIC DELAY10US
RSEG ?PR?DELAY10US
;16.3US
DELAY10US:
PUSH 05H ;2
MOV r5, #20 ;10
DE10S1:
DJNZ r5, DE10S1 ;5*2=10
POP 05H ;2
RET
?PR?CLSSIGNAL SEGMENT CODE
PUBLIC CLSSIGNAL
RSEG ?PR?CLSSIGNAL
CLSSIGNAL:
;WHEN SYSTEM SEND INFORMATION TO PINPAD, SEND STOP BIT AT END, THEN NEXT A
;SEND OPERATION. SO WAITTING STOP BIT FINISHED.
CLSL1:
PUSH 05H
CLSL1_U:
MOV R5, #6EH
CLSL2: JNB H_DATA, CLSL1_U
JNB H_CLK, CLSL1_U
DJNZ R5, CLSL2
POP 05H
RET
这个就是用于51的,关于发送和接收的部分都是c代码,已经没有问题了,关键是这几个函数是单独用的汇编代码,能否严格的将这段代码转换成等价的c代码?谢谢。
CLSSIGNAL:
;WHEN SYSTEM SEND INFORMATION TO PINPAD, SEND STOP BIT AT END, THEN NEXT A
;SEND OPERATION. SO WAITTING STOP BIT FINISHED.
CLSL1:
PUSH 05H
CLSL1_U:
MOV R5, #6EH
CLSL2: JNB H_DATA, CLSL1_U
JNB H_CLK, CLSL1_U
DJNZ R5, CLSL2
POP 05H
RET