By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,655 Members | 962 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,655 IT Pros & Developers. It's quick & easy.

using the parallel port

P: n/a
I am looking to read a byte or write a byte on the parallel port in linux.
I am using red hat 7.3. I tired using this but i couldnt get anywere.
{
unsigned char value;
__asm__ volatile ("inb %1,%0"
: "=a" (value)
: "d" ((unsigned short)port));
return value;
} */

static inline void port_out( unsigned short int port, unsigned char val )
{
__asm__ volatile (
"outb %0,%1\n"
:
: "a" (val), "d" (port)
);
}

what am i missing, what else can i do?

thanks

joe


Jul 22 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Joseph Suprenant" <la******@yahoo.com> wrote...
I am looking to read a byte or write a byte on the parallel port in linux.
I am using red hat 7.3. I tired using this but i couldnt get anywere.
{ [non-standard code removed] }

what am i missing, what else can i do?


You're missing the fact that standard C++ (the subject of this
newsgroup) has no means to "read a byte or write a byte on the
parallel port". You need to use system-specific solutions,
which are discussed in comp.os.linux.development.* family of
newsgroups.
Jul 22 '05 #2

P: n/a
I am missing the fact? Please point the fact out to me, so i won't miss it
next time.

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:zncvb.256862$HS4.2314084@attbi_s01...
"Joseph Suprenant" <la******@yahoo.com> wrote...
I am looking to read a byte or write a byte on the parallel port in linux. I am using red hat 7.3. I tired using this but i couldnt get anywere.
{

[non-standard code removed]
}

what am i missing, what else can i do?


You're missing the fact that standard C++ (the subject of this
newsgroup) has no means to "read a byte or write a byte on the
parallel port". You need to use system-specific solutions,
which are discussed in comp.os.linux.development.* family of
newsgroups.

Jul 22 '05 #3

P: n/a
"Joseph Suprenant" <la******@yahoo.com> wrote...
I am missing the fact? Please point the fact out to me, so i won't miss it
next time.
Is English a second language to you? Am I really so unclear in
the first sentence of my reply?

You are missing the fact _that_ standard C++ has no means to do
what you want. The fact is: standard C++ has no means to access
hardware. You are apparently missing that. How else would you
like me to "point the fact out" to you?

Well, let's try. Fact: standard C++ has no means to access
hardware (parallel port included). "No means" designates the
situation that there are _no_ mechanisms in the _language_ which
would result in a program that performs the actions required.

You have used non-standard elements, provided to you by some
[unrelated] platform (MS-DOS, maybe?). You're now on a different
platform, apparently (Linux). You _got_ to use different, yet
still platform-specific means. All that because the standard
C++ _language_ does not have such means, they are provided by
the platform. And that's what you've been missing.

Platform-specific solutions are discussed in their respective
newsgroups, not here. That you may not have been missing, or,
perhaps you have, that's unclear to me.

And, please don't top-post.

If you need more detailed explanation about the common rules of
this newsgroup, please turn to the Welcome message posted here
periodically by Shiva (also at www.slack.net/~shiva/welcome.txt)
and the FAQ Lite (www.parashift.com/c++-faq-lite/)

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:zncvb.256862$HS4.2314084@attbi_s01...
"Joseph Suprenant" <la******@yahoo.com> wrote...
I am looking to read a byte or write a byte on the parallel port in linux. I am using red hat 7.3. I tired using this but i couldnt get anywere. {

[non-standard code removed]
}

what am i missing, what else can i do?


You're missing the fact that standard C++ (the subject of this
newsgroup) has no means to "read a byte or write a byte on the
parallel port". You need to use system-specific solutions,
which are discussed in comp.os.linux.development.* family of
newsgroups.


Jul 22 '05 #4

P: n/a
"Joseph Suprenant" <la******@yahoo.com> wrote in message
news:e2********************@twister.nyroc.rr.com.. .
I am missing the fact? Please point the fact out to me, so i won't miss it
next time.


He did point it out. Standard C++ (the topic of this group)
has no notion of 'parallel ports' or any other particular
hardware devices. All i/o is abstracted as 'streams of characters'.

What you're asking is outside the purview of standard C++,
but can indeed be accomplished with platform-specific tools.
But platform-specific issues are not topical in comp.lang.c++
Please see the FAQ:
http://www.parashift.com/c++-faq-lite/

The above facts can be easily deduced by reading the international
standardization document which defines the C++ language
(ISO/IEC 14882). What is not defined in that document is,
by definition, not part of the language. Nothing about
'parallel ports' is mentioned in that document, a copy of
which I have. You can take my word for it, or confirm it
for yourself by getting your own copy, it's only 18 U.S.
dollars for a .PDF format copy, available from www.ansi.org
BTW, please don't top post. Thank you.

-Mike
Jul 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.