-
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
-
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.