Parallel port

This is a discussion on Parallel port within the C++ Programming forums, part of the General Programming Boards category; I would like to send data to the parallel port. The material that I have read sujest outp() or outportb(). ...

  1. #1
    Unregistered
    Guest

    Parallel port

    I would like to send data to the parallel port. The material that I have read sujest outp() or outportb(). None of these work for me and I don't know why. I use DEV 4.0 with mingw 2.95.2. I am 6 months new to C and self taught. Here is my simple code:

    #include<stdio.h>
    #include<dos.h>
    #include<conio.h>

    int main()
    {
    outportb(0x378, 0xff);
    getch();
    }

    The error I get is "implicit declaration of fuction init outportb()". Is the problem my compiler?

    Thank you,
    Andy

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    have you included the right file? maybe the name of the function is wrong. it might be your compiler, if not those two things.

    if you can't find the right function, you could try the assembly equivalent. in intel syntax (afaik):
    Code:
    push dx
    push ax
    mov dx,0x378
    mov al,0xFF
    out dx,al
    pop ax
    pop dx
    at&t syntax (which is what you need in dev-c++) is slightly different, but the commands themselves are the same. this is just an idea, btw, i've never done that, but i think it should work.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Parallel Port IO ops not working properly
    By microtechno in forum Linux Programming
    Replies: 16
    Last Post: 06-08-2009, 01:33 PM
  2. Parallel Port to USB controller and outb()
    By coletek in forum Linux Programming
    Replies: 1
    Last Post: 06-05-2009, 07:57 AM
  3. Replies: 3
    Last Post: 02-29-2008, 01:29 PM
  4. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 06:49 PM
  5. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 04:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21