Thread: Parallel port

  1. #1

    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:


    int main()
    outportb(0x378, 0xff);

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

    Thank you,

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    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):
    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, 12:33 PM
  2. Parallel Port to USB controller and outb()
    By coletek in forum Linux Programming
    Replies: 1
    Last Post: 06-05-2009, 06: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, 05:49 PM
  5. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 03:28 AM