Solved

inp() outp()

Posted on 1999-01-09
8
1,492 Views
Last Modified: 2008-02-26
how do I use these in linux. I cannot seem to find them.
are they in a different header file. In DOS I thought they in stdio.h ?
0
Comment
Question by:strmtrpr
8 Comments
 
LVL 8

Expert Comment

by:jhurst
ID: 1255698
They are not standard functions - please look in any standard C reference.  It sounds like your c compiler/library had some extra functions and that they included them in stdio.h which was really setting you up for the fall that has now happened.

If you share with us what they do someone may know of an alternative that will do the same.
0
 

Author Comment

by:strmtrpr
ID: 1255699
inp() and outp()  are in conio.h  I am trying to read info from a port and send info to a port.
in linux.
0
 
LVL 3

Expert Comment

by:idt
ID: 1255700
You will not find these in linux environ.. they are not ansi standard,
microsoft c had them in prototyped in conio.h. and compatability listed was DOS only.
I do not believe there is an ansi standard function to do the job that these functions did
you may have to write a bit of assemby to accomplish the same function.
0
 

Author Comment

by:strmtrpr
ID: 1255701
thank you
0
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 
LVL 2

Expert Comment

by:harrys
ID: 1255702
You could use inp_b() and outp_b() from <asm/io.h> instead...

0
 
LVL 4

Expert Comment

by:nil_dib
ID: 1255703
0
 

Accepted Solution

by:
ddgamer earned 20 total points
ID: 1255704
Yes. The answer to your problem is to write in asm. Here is an assembly example to perform an input and output operation.  Write the code inline such as:

This example shows how to read a pixel in Read Mode 0

asm{
     mov   dx, 3ceh
     mov   al 4
     out   dx, al
     inc   dx
     mov   cx, 4
     xor   al,al

 next_bit_plane:
     out   dx, al
     mov   ah, si
     mov   es:di, ah
     inc   di
     inc   al
     loop  next_bit_plane
}

I didn't include comments because the point was just to show you how to write an inline asm routine using the input/output commands.

Just insert into a function and everything will work fine, aside from the slight overhead of pushing everything onto the stack and popping it afterwards.
0
 

Author Comment

by:strmtrpr
ID: 1255705
thanks you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now