Comm ports

 BBS: Inland Empire Archive
Date: 10-15-92 (10:15)             Number: 272
From: LAWRENCE GORDON              Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: Comm ports                     Conf: (2) Quik_Bas
 On 10-13-92 Chris Wagner wrote to Ray Carson...

 CW>  LG> So, instead of losing this conference, I would
 CW>  LG> rather see Chris open it
 CW>  LG> up to all the MS-DOS BASICs, including PowerBasic,
 CW>  This conference is open to ALL of the BASIC languages, and the BASIC7
 CW>  conference is open to the professional versions of the same basics.

Chris: you've made my day!

Here's a routine for setting the memory locations for Comm ports
1 through 4.  It works in PowerBasic, and may even work in QB
with some modifications:


CALL SETPORTS ' initializes port addresses (not done by DOS)

def seg=&h40
poke 0,&hf8  '03F8  sets com1 address irq 4
poke 1,&h03
poke 2,&hf8  '02F8  sets com2 address irq 3
poke 3,&h02
poke 4,&he8  '03E8  sets com3 address irq 4
poke 5,&h03
poke 6,&he8  '02E8  sets com4 address irq 3
poke 7,&h02
def seg

First, use the Setports routine to initialize the port addresses,
and then you can access COM1 through COM4 when you OPEN COM:

OPEN "COM4:9600,N,8,1..."

This routine will work on just about any IBM compatible. If you've
changed memory locations or IRQ addresses, just change the
initialization sequence to reflect your actual setup.

... OFFLINE 1.42

--- Maximus 2.00
 * Origin: St. Louis User's Group BBS (1:100/4)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET