|
发表于 2010-1-24 14:51:43
|
显示全部楼层
哪位大侠能把这段汇编转成c代码吗?主要是晶振频率比较少见,想改又不懂汇编,呵呵。
H_DATA BIT P3.2
H_CLK BIT P3.4
?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
END |
|