Solved

Code to out put to a port

Posted on 1998-11-05
6
177 Views
Last Modified: 2010-05-18
How do you output data to a serial port??
0
Comment
Question by:srapsey
6 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 1254033
What OS are you using?
0
 
LVL 1

Expert Comment

by:MatthewL
ID: 1254034
On an IBM PC Compatiblble, you can use int 14H.

If you want info on the interrupt, I can post it for you.

Matt
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1254035
use assembler...

void main()
{
  asm{
    out reg, reg
    //rest of asm code...
  }
}

Note: Is a register

Cheers,
Viktor
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 10

Expert Comment

by:viktornet
ID: 1254036
use assembler...

void main()
{
  asm{
    out reg, reg
    //rest of asm code...
  }
}

Note: reg is a register

Cheers,
Viktor
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1254037
Sorry for double posting....
0
 
LVL 2

Accepted Solution

by:
helver earned 50 total points
ID: 1254038
It's really OS dependent.  If you're using Linux you can open /dev/ttyS? for writing and that should do it... Then just treat it as a regular file descriptor or stream.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
List out all word 7 316
c++ substatte a varabe for a string in a LPCTSTR statment 8 88
How to build c program using make in mingw environment? 9 70
How to learn Linux? 10 66
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…
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 recursion 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.

790 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