Buffered TX and RX (SX/B + Assembly)

My purpose in sharing this is two-fold:
1) I needed it; someone else may as well.
2) To demonstrate that with very little effort we mortals can take code from gurus like Guenter, Peter, etc., and fold it into our SX/B programs. Terry has done a great job constructing SX/B to allow the smooth incorporation of Assembly segments and I think this is a pretty good demonstration of that.
Notes:
-- TX and RX [noparse][[/noparse]circular] buffers are each eight bytes
-- TX and RX vars and code are independent of each other and can be pulled out and used separately
-- code prevents overrun of buffers when full
-- DELAY_MS used to replace PAUSE -- allows RX and TX while performing the delay
I've tested at the limits: 1200 and 38400 baud. Please let me know if you find any issues as this is getting folded into the latter chapters of my book. Thanks.
1) I needed it; someone else may as well.
2) To demonstrate that with very little effort we mortals can take code from gurus like Guenter, Peter, etc., and fold it into our SX/B programs. Terry has done a great job constructing SX/B to allow the smooth incorporation of Assembly segments and I think this is a pretty good demonstration of that.
Notes:
-- TX and RX [noparse][[/noparse]circular] buffers are each eight bytes
-- TX and RX vars and code are independent of each other and can be pulled out and used separately
-- code prevents overrun of buffers when full
-- DELAY_MS used to replace PAUSE -- allows RX and TX while performing the delay
I've tested at the limits: 1200 and 38400 baud. Please let me know if you find any issues as this is getting folded into the latter chapters of my book. Thanks.
Comments
When attempting to compile I got an error. See attached jpg screenshot.
You'll have to add a "RETURN __PARAM1" before the ENDFUNC to satisfy the compiler.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Teacher: What is the difference between ignorance and apathy ?
Student: I don't know and I don't care
Teacher: Correct !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
Is that because the compiler expects the FUNC keyword to have an associated RETURN? I'm using 1.51.03 so I have not see the problem reported by T&E.
· Yes, it is expecting to see a RETURN somewhere within FUNC...ENDFUNC (I'll have to change the wording of the error message since it references ENDSUB which CAN be used without a return).
· It probably should be a warning instead of an error, since it doesn't prevent anything from compiling.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Teacher: What is the difference between ignorance and apathy ?
Student: I don't know and I don't care
Teacher: Correct !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·