port addresses

 BBS: Inland Empire Archive
Date: 05-29-92 (23:39)             Number: 161
From: SCOTT DRYSDALE               Refer#: NONE
  To: JOHN GALLAS                   Recvd: NO  
Subj: port addresses                 Conf: (2) Quik_Bas
I qoute:

 JG>   Can someone list the addresses for all the com ports

1 &H3FC
2 &H2FC
3 &H3EC
4 &H2EC

 JG> (1-8)?  And by the way, why can't you use pas com 4 in

DEFINT A-Z
SUB opencom3 (baud%, par$, dat%, sto%)
        DEF SEG = 0
        COM1.1 = PEEK(&H400): COM1.2 = PEEK(&H401)
        COM2.1 = PEEK(&H402): COM2.2 = PEEK(&H403)
        COM3.1 = PEEK(&H404): COM3.2 = PEEK(&H405)
        COM4.1 = PEEK(&H406): COM4.2 = PEEK(&H407)
        DEF SEG
        DEF SEG = 0
        POKE &H400, COM3.1: POKE &H401, COM3.2
        POKE &H404, COM1.1: POKE &H405, COM1.2
        DEF SEG
        OPEN "COM1:" + STR$(baud%) + "," + par$ + "," +
STR$(dat%) + "," + STR$(sto%) FOR RANDOM AS #1
END SUB

SUB opencom4 (baud%, par$, dat%, sto%)
        DEF SEG = 0
        COM1.1 = PEEK(&H400): COM1.2 = PEEK(&H401)
        COM2.1 = PEEK(&H402): COM2.2 = PEEK(&H403)
        COM3.1 = PEEK(&H404): COM3.2 = PEEK(&H405)
        COM4.1 = PEEK(&H406): COM4.2 = PEEK(&H407)
        DEF SEG
        DEF SEG = 0
        POKE &H402, COM4.1: POKE &H403, COM4.2
        POKE &H406, COM2.1: POKE &H407, COM2.2
        DEF SEG
        OPEN "COM2:" + STR$(baud%) + "," + par$ + "," + STR$(dat%) + "," +
STR$(sto%) FOR RANDOM AS #1
END SUB


 JG> QB?  Why can't you just print to the &Hxxx?

Out portadd, 3

   Party on eh!

P.S.  I always have to trap An error 68 and re-run the opening of the port.








--- Maximus 2.01wb
 * Origin: The BULLpen BBS * Intel 14.4EX (613)549-5168 (1:249/140)
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