Solved

inp() outp()

Posted on 1999-01-09
8
1,506 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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
 
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 AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
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…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.

825 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