Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

Code to out put to a port

How do you output data to a serial port??
0
srapsey
Asked:
srapsey
1 Solution
 
jkrCommented:
What OS are you using?
0
 
MatthewLCommented:
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
 
viktornetCommented:
use assembler...

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

Note: Is a register

Cheers,
Viktor
0
Industry Leaders: 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!

 
viktornetCommented:
use assembler...

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

Note: reg is a register

Cheers,
Viktor
0
 
viktornetCommented:
Sorry for double posting....
0
 
helverCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now