Solved

Code to out put to a port

Posted on 1998-11-05
6
179 Views
Last Modified: 2010-05-18
How do you output data to a serial port??
0
Comment
Question by:srapsey
[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
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
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!

 
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

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

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
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…
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 switch statements 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