相关代码 |
|
SDA BIT P1.0 CLK BIT P1.1 INPUT BIT P3.5 LED_CS BIT P1.7 ORG 4000H AJMP MAIN ORG 4100H MAIN: MOV SP,#60H SETB INPUT clr P1.7 UP: JNB INPUT,NEXTP MOV R2,#00 AJMP NEXTPP NEXTP: MOV R2,#0FFH NEXTPP: ACALL TXDBYTE AJMP UP ;若发送的数据存放在R2中 TXDBYTE: PUSH PSW PUSH ACC MOV A,R2 MOV R3,#08H TXDUP: RLC A MOV SDA,C CLR CLK SETB CLK DJNZ R3,TXDUP POP ACC POP PSW RET END
相关资源 |
|