相关代码 |
|
;11-8-1.ASM $MOD51 ORG 0000H START: MOV TMOD,#20H ; TIMER1 = MODE2 MOV TH1,#0FDH ; 9600b/s SETB TR1 ; START TIMER1 MOV SCON,#50H ; SERIAL MODE1, ENABLE UART CLR RI ; RI=0 ; WAIT: JNB RI,WAIT ; WAIT FOR RECEIVE OK CLR RI ; RI=0 MOV A,SBUF ; READ DATA CPL A ; CPL ACC MOV P1,A ; SHOW DATA ON P1 SJMP WAIT ;WAIT NEXT BYTE ; END
相关资源 |
|