comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: Re: Parallel port
Date: 2000/03/07
Date: 2000-03-07T00:00:00+00:00	[thread overview]
Message-ID: <QWXw4.2724$zz5.79821@news.pacbell.net> (raw)
In-Reply-To: xVTw4.1181$Sv6.8157432@nnrp3.proxad.net

>Is the library Vendor_Specific_IO_Library is avaible on all ada compilers ?
>>   Vendor_Specific_IO_Library.Output(port=>16#378#, data=>data_value);
  I'm sure nothing of that exact name is offered by *anyone*.

When run under Windows 95, the following program displays a status of
87 when my old Epson printer is plugged into LPT1 and powered on,
and a status of 127 when it's powered off.

with claw.message_box,   -- nonstandard
     system,
     bit;                -- nonstandard
procedure test is
  use claw.message_box;
  status : system.byte;  -- nonstandard
begin
  message_box(text=>"ready?",
              caption=>"lpt1 status",
              flags=>make_flags);
  -- initialize
  bit.outport(16#37A#, 12);
  delay 0.05;
  bit.outport(16#37A#, 8);
  delay 0.01;
  -- check status
  bit.inport(16#379#, status);
  message_box(text=>"status is" & system.byte'image(status),
              caption=>"lpt1 status",
              flags=>make_flags);
end test;

But the package "bit", as well as the type "system.byte", are
extras that come with the Janus Ada compiler.  Other compilers
probably have something similar - look at your compiler's
documentation.

  Failing that, in decreasing order of ease,
  Can you do a "pragma Import" on an existing (C?) function to do
the byte level IO?
  You can always write the needed IO routines in assembly language,
then use "pragma Import" to make them accessible to your Ada program.
  Look at your compiler's documentation on package System.Machine_Code,
and use that to make the necessary IO instructions.
  As has been pointed out, some versions of Windows will only allow
"device drivers" that kind of hardware access, and will kill your
program if you try it from a "user program".




  reply	other threads:[~2000-03-07  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-05  0:00 Parallel port Philippe Bourzeix
2000-03-05  0:00 ` Jerry van Dijk
2000-03-06  0:00   ` Philippe BOURZEIX
2000-03-06  0:00     ` Ted Dennison
2000-03-06  0:00       ` Gisle S�lensminde
2000-03-06  0:00         ` Philippe Bourzeix
2000-03-08  0:00           ` Gisle S�lensminde
2000-03-06  0:00         ` Ted Dennison
2000-03-06  0:00       ` tmoran
2000-03-06  0:00         ` Philippe Bourzeix
2000-03-07  0:00           ` tmoran [this message]
2000-03-06  0:00     ` Philippe Bourzeix
2000-03-05  0:00 ` Tarjei Tj�stheim Jensen
  -- strict thread matches above, loose matches on Subject: below --
2000-03-19  0:00 Parallel Port Philippe Bourzeix
2000-03-19  0:00 ` Ed Falis
2000-03-20  0:00   ` Philippe BOURZEIX
2000-03-20  0:00     ` Gautier
2000-03-20  0:00       ` Jerry van Dijk
2000-03-20  0:00         ` Gautier
2000-03-19  0:00 ` Dale Stanbrough
2000-03-20  0:00   ` Philippe BOURZEIX
2000-03-21  0:00 ` Philippe BOURZEIX
2000-03-21  0:00   ` tmoran
2001-01-17  9:18 PARALLEL PORT Szymar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox