Tuesday, November 22, 2011

assembly language subroutine code for serial data send and recieve

; SEND SERIAL DATA

SEND :
MOV SBUF, A        ; LOAD DATA IN BUFFER
HERE :
JNB TI, HERE        ; WAIT TILL LAST BIT IS GONE
CLR TI            ; GET READY FOR NEXT CHARACTER
RET            ; RETURN TO CALLER

; RECIEVE SERIAL DATA

RECV :
JNB RI, RECV        ; WAIT TILL LAST BIT HAS COME
MOV A, SBUF        ;
CLR RI            ; GET READY FOR NEXT CHARACTER
RET            ; RETURN TO NEXT CHARACTER

No comments:

Post a Comment