From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd3c44bd8f938354 X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Parallel port Date: 2000/03/07 Message-ID: #1/1 X-Deja-AN: 594040672 References: X-Complaints-To: abuse@pacbell.net X-Trace: news.pacbell.net 952388400 207.214.211.40 (Mon, 06 Mar 2000 16:20:00 PST) Organization: SBC Internet Services NNTP-Posting-Date: Mon, 06 Mar 2000 16:20:00 PST Newsgroups: comp.lang.ada Date: 2000-03-07T00:00:00+00:00 List-Id: >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".