Hello,
I am trying to determine the address of the parallel ports on a PC. The base address is $408, this should hold 888 (lpt1 $378).
I have this code segement but I get an access violation. I am not sure if Windows XP is preventing me from reading the data from this memory location.
If anyone could shed some light on this problem or even offer an alternative solution I would be most grateful.
As an aside, I have a PCI parallel port also. How do I write/read to this port? Where can I find the address of this port.
Thanks
Alvin
I am trying to determine the address of the parallel ports on a PC. The base address is $408, this should hold 888 (lpt1 $378).
I have this code segement but I get an access violation. I am not sure if Windows XP is preventing me from reading the data from this memory location.
If anyone could shed some light on this problem or even offer an alternative solution I would be most grateful.
As an aside, I have a PCI parallel port also. How do I write/read to this port? Where can I find the address of this port.
Thanks
Alvin
Code:
procedure find_port ;
var
ptraddr : ^cardinal; //* Pointer to location of Port Addresses */
LPTAddress : array[1..3] of cardinal; //* Address of Port */
count : integer;
begin
ptraddr:=ptr($00000408);
for count := 1 to 3 do
begin
LPTAddress[count] := (ptraddr^);
if ( LPTAddress[count] = 0 ) then
showmessage('No port found for LPT'+inttostr(count))
else
showmessage('LPT'+inttostr(count)+' is '+inttostr(LPTAddress[count]));
inc(ptraddr);
end;
end;