Solved

inp() outp()

Posted on 1999-01-09
8
1,522 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

726 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