Solved

inp() outp()

Posted on 1999-01-09
8
1,477 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
thank you
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 2

Expert Comment

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

0
 
LVL 4

Expert Comment

by:nil_dib
Comment Utility
0
 

Accepted Solution

by:
ddgamer earned 20 total points
Comment Utility
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
Comment Utility
thanks you
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
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…
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.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

744 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