home *** CD-ROM | disk | FTP | other *** search
- This is a revised version of DJ's async handler. The file diffs.10b
- gives a diff from DJASY100 to these files.
-
- changes from v. 100 to 10A
-
- 1) Can now have two handlers TSR'd at the same time. The interface
- routines in async.c take a port argument (0 or 1, for COM1 or COM2)
- and you can use both ports in the same program.
-
- 2) Now has protection against ring buffer corruption since I disable
- interrupts while the C interface is accessing the ring buffer.
-
- 3) The receive buffer is larger -- it's 4096 bytes, not 500. But you
- can change this to any value you want by modifying asynctsr.asm and
- rebuilding the tsr.
-
- 4) The makefile is set up to use TASM, not MASM (you may or may not
- consider this an enhancement, depending on how you feel about <gag>
- MASM).
-
- 5) I prototyped the interface in djasync.h.
-
- 6) I added a C++ class DJAsync if you like that interface better.
-
- 7) I added overflow checking so that the app can find out if the ring
- buffer overlowed. This is done as a counter of the # of characters
- that got clobbered which is returned (and reset) by calling the API
- function async_overflow(port).
-
- 9) added atestpp which uses the class interface.
-
- 10) added port argument to atest and atestpp, defaults to 1.
-
- changes from 10A to 10B:
-
- 1) asynctsr now takes the receive buffer size in bytes as an optional
- command line argument.
-
- changes from 10B to 10C:
-
- 1) implemented code which if assembled in flushes the buffer on an
- overflow, rather than just tossing the offending character.
-
- changes from 10C to 10D:
-
- 1) fixed code implemented in 10B->10C fix, which couldn't be
- assembled in based on the symbol I used.
-
- 2) made this code a run time thing (see usage message).
-
- 3) fixed bug where you could allocate a buffer of 0 bytes, maybe
- even accidentally, like saying "asynctsr 1000", which would really
- buffer port 1 with no buffer at all (not nice).
-
- 4) added command line option to atest and atestpp, so you can
- specify whether or not to display on the top line the buffer count
- and overflow count, and optionally add a delay between polling for
- characters from the buffer. This aids tremendously in debugging.
-
- format is now:
-
- atest port# [delay_in_msec]
-
- if delay_in_msec is 0, no delay is used, but the top line display is
- enabled.
-
- Note:
-
- I didn't implement interrupt-driven transmission because of the
- real-mode vs. protected-mode difficulties involved in passing
- buffers around. I may do something about this at a later time. Right
- now, this code does what I need.
-
- All original copyrights etc apply to this code as well.
-
- J. Alan Eldridge
- Liberty Brokerage
- 77 Water St.
- New York, NY 10005
-