这是串口中断服务程序 完成接收两个字节的任务,其中第一个字节是地址,须与存放在30H的内容一致,然后发送本机地址加24字节数据,与计算机串口调试程序调试时,串口没反映。 UART: PUSH ACC PUSH PSW PUSH 01H
JBC TI,OVER ;UART INTERRUPT WAIT: JBC RI,READ AJMP WAIT READ: MOV R2,#1AH MOV R0,#40H MOV R3,#80H JB 00H,REC MOV A,SBUF CJNE A,30H,OUT SETB 00H MOV R3,A MOV R1,A LJMP OUT REC: MOV A,SBUF MOV @R1,A INC R1 CJNE R1,#81H,OUT CLR 00H SETB P3.2 CLR P3.3
MOV A,30H MOV SBUF,A
DEC R2 LJMP OUT CON: ;CLR TB8 MOV A,@R0 MOV SBUF,A INC R0 LJMP OUT OVER: DJNZ R2,CON OUT: POP 01H POP PSW POP ACC RETI |