This document contains code for serial communication in assembly language. It initializes the serial port by configuring the timer and serial control registers. It then enters a loop that sends the characters "GMIT" repeatedly over the serial port by moving each character to the serial buffer register and waiting for transmission to complete before sending the next one. A message string containing "GMIT" with a terminating byte is also defined to allow sending the message by incrementing a pointer through the string rather than individual characters.
This document contains code for serial communication in assembly language. It initializes the serial port by configuring the timer and serial control registers. It then enters a loop that sends the characters "GMIT" repeatedly over the serial port by moving each character to the serial buffer register and waiting for transmission to complete before sending the next one. A message string containing "GMIT" with a terminating byte is also defined to allow sending the message by incrementing a pointer through the string rather than individual characters.
This document contains code for serial communication in assembly language. It initializes the serial port by configuring the timer and serial control registers. It then enters a loop that sends the characters "GMIT" repeatedly over the serial port by moving each character to the serial buffer register and waiting for transmission to complete before sending the next one. A message string containing "GMIT" with a terminating byte is also defined to allow sending the message by incrementing a pointer through the string rather than individual characters.
(Refer after reading Module-4) (Refer after reading Module-4)
ORG 00H ORG 00h
MOV TMOD, #20H MOV TMOD,#20h MOV TH1, #-3 MOV TH1,#-3 MOV SCON, #50H MOV SCON,#50h SETB TR1 SETB TR1 UP: MOV A, #'G' REPEAT: ACALL SEND MOV DPTR, #msg MOV A, #'M' UP: CLR A ACALL SEND MOVC A,@A+DPTR MOV A, #'I' JZ REPEAT ACALL SEND ACALL SEND MOV A, #'T' INC DPTR ACALL SEND SJMP UP SJMP UP SEND: SEND: MOV SBUF, A MOV SBUF,A HERE: JNB TI, HERE HERE: JNB TI, HERE CLR TI CLR TI RET RET END msg: db "GMIT",0 END