answersLogoWhite

0


Best Answer

Parallel port is the most simplest port of computer to use. It is too simple to use in Turbo C++ .

there are two types of parallel ports of computer

1. SPP (standard parallel port) = 0x3bc

2. ECP (Enhanced communication port) or EPP(Enhanced parallel port) = 0x378

parallel port is divided into three ports

1. DATA port = 0x3bc OR 0x378

2. control port = 0x3bd OR 0x379

3. status port = 0x3be OR 0x37a

data port is consists of 8 pins and use 8 bit binary code for controlling..

D7 D6 D5 D4 D3 D2 D1 D0

128 64 32 16 8 4 2 1

1 1 1 1 1 1 1 1 = 255..................send 255 int as data for binary all 1s

D7 D6 D5 D4 D3 D2 D1 D0

128 64 32 16 8 4 2 1

0 0 0 0 0 0 0 0 = 0..............send 0 int as data for binary all 0s

D7 D6 D5 D4 D3 D2 D1 D0

128 64 32 16 8 4 2 1

0 0 0 1 0 0 0 0 = 16............send 16 int as data for binary 1 in pin (D0)

D0= pin 2

D1= pin 3

D2= pin 4

D3= pin 5

D4= pin 6

D5= pin 7

D6= pin 8

D7= pin 9

outp(port,data); is the function use send data to the ports.

where ,

port is the integer value of port..... 0x378 or 0x3bc or 0x379 or 0x3bd or 0x37a or 0x3be.

data is an integer value to send ..ranges from 0 to 255

data=inp(port); is the function to receive input from port.

data is integer data .....0-255

port is the integer value of port..... 0x378 or 0x3bc or 0x379 or 0x3bd or 0x37a or 0x3be.

Example:

#include<stdio.h>

#include<conio.h>

#include<dos.h>

void main (void)

{

int data=0, portin=0x37a, portout=0x378;

//send 255 to port....using data pins.

data=255;

outp(portout,data);

//input from port using status pins...

data=inp(portin);

printf("\n%d",data);

getch();

}

In this way we control parallel port in turbo C++

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How parallel port is used in turbo c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How Can you access Parallel Port using c plus plus?

You cannot directly access the parallel port because the operating system is managing that device. Use the file system. The name of the parallel port is "lpt1:". Open that as an ordinary file for write, write to it, and you will be writing on the parallel port.


What can be used to test a serial port parallel port USB port Network port or other ports?

you can test it by using software&amp; hardware.After connecting the parallel port in your cpu's back side and connect a small wire between 2 &amp; 3 pin on another end of the cable ,then run a c program(in dos) fro transmiter and receiver.If ur parallel port is working then u can see both transmitted data &amp; received data on ur PC.


What is the differentiate of turbo c from turbo c plus plus?

Turbo C compiles c source. turbo c++ compiles c++ source code.


What does the command parallelput do?

The command, parallelput sends binary information to the parallel port on a PC. The command appears in a number of different computer programming languages such as C/C++ and Delphi but may have equivalents in other languages. It's worth noting that most modern PC clone computers don't have a parallel port anymore. On older machines it was used to drive the printer and was noticable by its large 25 way D connector and flat ribbon cable. The data lines of a parallel port are 8 bit (0-255) and labelled DB0 through DB7. In C the command is parallelput (value) where the value is the 8 bit binary value to be sent to the parallel (print) connector. Therefore the command in parallelput (3) would send the binary 00000011 to the parallel port which would in turn switch on DB0 and DB1 on the port. The parallel port is bidirectional and thus can receive information too using the parallelget command. Chris Neary Bsc hons FdSc


How turbo c executes c as well as c?

turbo c cannot execute c++ as well..since c++ is the superset of c .the cprograms can be compiled in turbo c++.


What is Turbo C download used for?

Turbo C is a compiler for a general purpose computer programming language called C. It transforms code written in C into the computer language needed for executable programming.


Syntax of turbo c?

+ += - -= * *= / /= % %= = == != &lt;= &gt;= &amp; &amp;&amp; | ^ ~ &lt;&lt; &lt;&lt;= &gt;&gt; &gt;&gt;= , [] () are the basic operator in TURBO C


What are the basic operator in turbo c?

+ += - -= * *= / /= % %= = == != &lt;= &gt;= &amp; &amp;&amp; | ^ ~ &lt;&lt; &lt;&lt;= &gt;&gt; &gt;&gt;= , [] () are the basic operator in TURBO C


What is the name of the driver file that manages your parallel port in windows vista?

parport.sys - usually located in C:\Windows\system32\DRIVERS\


What is difference between Turbo and Borland C?

turbo is word to do the programming language in c &amp; c++ and i do no about borland


Is there any difference between turbo c and c plus plus?

turbo c is a compiler and c++ is a programming language.


What are examples of turbo c?

1. Turbo C is an example of Integrated Developing Environment. 2. Turbo C has example programs, the most important is bgidemo.c