Board index » delphi » Addresses of Printer- and Serial-ports ?

Addresses of Printer- and Serial-ports ?

Does anybody know the sourcecode needed to obtain
the addresses used for LPT1, COM1 and COM2 ?

(i.e. LPT1 could be 3BC or 378  - Com1 could be 3F8 etc...)

Any help is very appreciated!

 Erik Grindheim
"Delphi-newcomer"

 

Re:Addresses of Printer- and Serial-ports ?


Their found in low memory at 0:400, it's the first 7 "word"s.

Quote
Erik Grindheim <Erik.Grindh...@ifjf.uib.no> wrote in message

news:76tf8i$hui$1@toralf.uib.no...
Quote
>Does anybody know the sourcecode needed to obtain
>the addresses used for LPT1, COM1 and COM2 ?

>(i.e. LPT1 could be 3BC or 378  - Com1 could be 3F8 etc...)

>Any help is very appreciated!

> Erik Grindheim
>"Delphi-newcomer"

Re:Addresses of Printer- and Serial-ports ?


Tue, 5 Jan 1999 17:37:01 +0100, "Erik Grindheim"
<Erik.Grindh...@ifjf.uib.no> napisa3(a):

Quote
>Does anybody know the sourcecode needed to obtain
>the addresses used for LPT1, COM1 and COM2 ?

>(i.e. LPT1 could be 3BC or 378  - Com1 could be 3F8 etc...)

what for ?

Re:Addresses of Printer- and Serial-ports ?


Tnx for answer Paul,

...but how do I read at this address (sourcecode needed) to display LPT1's
address at a label?
(I'm using Win'98 and Delphi 4)

Quote
>Their found in low memory at 0:400, it's the first 7 "word"s.

>>Does anybody know the sourcecode needed to obtain
>>the addresses used for LPT1, COM1 and COM2 ?

>>(i.e. LPT1 could be 3BC or 378  - Com1 could be 3F8 etc...)

>>Any help is very appreciated!

>> Erik Grindheim
>>"Delphi-newcomer"

Re:Addresses of Printer- and Serial-ports ?


Well that's another kettle of fish <g>

In the 16 bit world you did something like

type m = array[1..7] of word;
var   mp : ^m;
begin
  mp := ptr(0;400);

or
var m : array[1..7] of word absolute [0:400];

Something like that, can't remember exact syntax offhand. Trouble is this
doesn't work for 32bit so you have to figure out how to get a selector for
low memory.

Send me an email copy when you've figured it out please <g>.

Quote
Erik Grindheim <Erik.Grindh...@ifjf.uib.no> wrote in message

news:771p4g$ph3$1@toralf.uib.no...
Quote
>Tnx for answer Paul,

>...but how do I read at this address (sourcecode needed) to display LPT1's
>address at a label?
>(I'm using Win'98 and Delphi 4)

>>Their found in low memory at 0:400, it's the first 7 "word"s.

>>>Does anybody know the sourcecode needed to obtain
>>>the addresses used for LPT1, COM1 and COM2 ?

>>>(i.e. LPT1 could be 3BC or 378  - Com1 could be 3F8 etc...)

>>>Any help is very appreciated!

>>> Erik Grindheim
>>>"Delphi-newcomer"

Other Threads