TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: BILL WHITE
from: PAT PRIDGEN
date: 1998-01-13 16:48:00
subject: COM Ports

[In a message from Bill White to All ]
 BW> I've seen the answer to this pass thru dozens
 BW> How do you open Com Port #3?
Here's some code from Matt Hart on the subject.
You swap the addresses for COM1 and COM2 with COM3 and COM4, then access
COM1 or COM2 and it will really be going to COM3 or COM4.  Like this:
SUB SwapCom1
    DEF SEG = &H40
    Com1.1 = PEEK(0)
    Com1.2 = PEEK(1)
    Com3.1 = PEEK(4)
    Com3.2 = PEEK(5)
    POKE 0,Com3.1
    POKE 1,Com3.2
    POKE 4,Com1.1
    POKE 5,Com1.2
    DEF SEG
END SUB
Com2 is peek/poke 2 & 3, Com4 is peek/poke 6 & 7.  Then:
CALL SwapCom1
OPEN "COM1" FOR BINARY AS 1    ' Buffer is actually COM3
CALL SwapCom1
.                         pat.pridgen@svis.org
.                          La Grande, Oregon
*SignIt 2.x #001* 
... Christian Science Programming: "Let God Debug It!"
___ Blue Wave/DOS v2.30
--- Maximus 2.02
---------------
* Origin: THE LOFT in Auburn IN 219-925-5524 & 238-3222 HST/V34+ (1:236/7)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.