using the parallel port

J

Joseph Suprenant

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
 
V

Victor Bazarov

Joseph Suprenant said:
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.
 
J

Joseph Suprenant

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

Victor Bazarov said:
Joseph Suprenant said:
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.
 
V

Victor Bazarov

Joseph Suprenant said:
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 said:
Joseph Suprenant said:
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.
 
M

Mike Wahler

Joseph Suprenant said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,286
Latest member
ChristieSo

Latest Threads

Top