Re: Comm Ports

 BBS: Inland Empire Archive
Date: 07-25-92 (01:06)             Number: 165
From: BRYAN HOOVER                 Refer#: NONE
  To: BRYAN LEGGO                   Recvd: NO  
Subj: Re: Comm Ports                 Conf: (2) Quik_Bas
+>Could someone post the code used to open QB on Comm Ports 3 and 4
=>because unless I missed something...

This works for me..

From: Larry Stone
To:   Jason Judge
Subj: Re: COM3 & COM4

The following code is an extract from a article by Lawrence Westhaver
of HUMBLEWARE Custom Programming. I have reformatted it for easier
readability and further clarity for QB novices.

'EXAMPLE: Accessing COM3: from QuickBASIC
   DEF SEG = 64       'move QuickBASIC segment pointer to BIOS data area
   POKE &H00,&HE8     'change com1: address in BIOS data area to com3:
   DEF SEG            'return to QB's DGROUP
                      'open com3: by issuing open "com1:" command
   OPEN "COM1:1200,N,8,1" FOR OUTPUT AS #1

   PRINT #1,"ATDT844-1212"   'print to comm port

   CLOSE #1           'close comm port

   DEF SEG = 64       'point to BIOS data area
   POKE &H00,&HF8     'restore "com1:" address in BIOS data area to com1:
   DEF SEG            'return to DGROUP
'EXAMPLE: Accessing COM4: from QuickBASIC

   DEF SEG = 64       'move QuickBASIC segment pointer to BIOS data area
   POKE &H02,&HE8     'change com2: address in BIOS data area to com4:
   DEF SEG            'return to DGROUP

'open com4: by issuing open com2: command
   OPEN "COM2:1200,N,8,1" FOR OUTPUT AS #1

   PRINT #1,"ATDT844-1212"   'print to comm port

   CLOSE #1           'close comm port

   DEF SEG = 64       'point to BIOS data area
   POKE &H02,&HF8     'restore com2: address in BIOS data area to com2:
   DEF SEG            'return to DGROUP

--- RBBSMail v18.1
 * Origin: FreeBoard BBS:<HST>WIN3dow to DTP(Va.:804-744-0744) (1:264/212.0)
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