?
Solved

inp() outp()

Posted on 1999-01-09
8
Medium Priority
?
1,598 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:strmtrpr
ID: 1255701
thank you
0
 
LVL 2

Expert Comment

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

0
 

Accepted Solution

by:
ddgamer earned 80 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.
Suggested Courses

850 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