PR> in an example in qbasic, i saw this
PR> &H3FC
PR> which stands for com 1
PR> but i cant find the address for ports 1-4
PR> it was used in the example....
PR> INP(&H3FC)
PR> with OUT etc
This code is actually untested, since I never had a need to
use it. I suppose I should test it, really, just to see if
it actually works. [ ... ] Well.. It works, but I still
can't get it to do 115200 bps. Oh well... There must be
something else involved I'm not taking into account.
Anyway, here it is.
The addresses for comm 1-4 are included in it.
'_|_|_| SETBPS.BAS
'_|_|_| Untested subroutine to set BPS rate on an open COM.
'_|_|_| No guarantee or warrantee is given or implied.
'_|_|_| Released PUBLIC DOMAIN by Kurt Kuzba. (12/12/96)
DECLARE SUB SetBPS (port%, bps&)
DIM COMM(1 TO 4) AS INTEGER
COMM(1) = &H3F8: COMM(2) = &H2F8: COMM(3) = &H3E8: COMM(4) = &H2E8
' open com before setting bps rate.
' example SetBPS COMM(2), 19200
' based on data contained in a book published by QUE
' Using Assembly Language by Allen L. Wyatt
'_|_|_| end SETPBS.BAS
SUB SetBPS (port%, bps&)
' Valid BPS rates:
' 115200, 19200, 9600, 4800, 2400, 1200, 300, 110
Div& = 115200 \ bps&: hi% = Div& \ 256: lo% = Div& AND 255
OUT port% + 3, INP(port% + 3) OR 128
OUT port%, lo%: OUT port% + 1, hi%
OUT port% + 3, INP(port% + 3) XOR 128
END SUB
> ] I'm heavily sedated and seriously thinking about blinking...
---
---------------
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
|