Question
18. (4 pts) Suppose you want to send a string in code memory to the serial port. The strategy is to have a subroutine called
18. (4 pts) Suppose you want to send a string in code memory to the serial port. The strategy is to have a subroutine called send string (below) that writes the first character to SBUF and to have the serial port ISR send the rest. You may assume dptr is used for this purpose and nothing else. Also, you may assume send string will not be called again until the string is completely transmitted. Write an interrupt service routine in the assembly that sends the remaining characters in the string. Have the ISR stop (i.e. clear TI as usual but do not send anything to SBUF) when it encounters a zero. Don't forget to restore any registers (e.g. accumulator) that the ISR alters. send_string: clr a movc a, @a+dptr jz null_string mov sbuf, a null_string: ret
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started