1. No its not really safe to directly use a parallel port of a laptop. You CAN try an LED or something, because the grounds can sink that much current from your port. However, dont try using motors directly. The links I have provided are VERY useful and have many circuits too. Read carefully. I cant cover that here, since everyone has their own design.
2. god, forgive me, I actually stoped programming PP in newer PC because of that problem (Windooz..input32.dll) but if you search you will get a LOT of info. As for the libraries, not many are needed. In win98 it were stdio.h and io.h or something. Very few. Here is a sample code I wrote 4 years ago (!):
Code:
//This example code shows how to switch a LED on/off in Visual C++.
//We use two variables N and L explained below.
//I am assuming you have some knowledge in C++. Instruction to connect the LED is given in the Tutorial.
#include <iostream.h> //The most important include to display data on screen.
#include <conio.h> //Include for outp and inp functions for the printer port.
#include <windows.h> //For _sleep functions for our time delay.
#define addr 0x3BC //IMPORTANT: Normaly 378 is the most common address,
//if not then insert your address instead of 378
int main()
{
int freq; //Variable for time delay.
int L; //Variable for counts of Blinking LED.
cout<<"\t\t XheavenlyX WELCOMES YOU!!! \n\n"; //How can I forget this ^_^
cout<<"How many times to blink?? Enter 0 to exit: "; //Ask user how many times to blink the LED
cin>>L; //And exit if zero is entered.
if (L==0)
{
cout<<endl<<"Exiting application..."<<endl; //Code to exit if L = 0.
for (int i=0;i<=5;i++) {_sleep(500);} //A lame pause before exit!
exit(0);
}
cout<<"Frequency (in mS): "; //Ask user to enter the frequency at which the LED will blink.
cin>>freq; //Store that value in freq.
//Bottom code is the Juice! This will blink your LED the number of times you put in L.
//The speed of blinks will depend on freq. As an example if you entered 500milliseconds. The LED
//will blink twice every second since 500ms is half of 1000ms (1000millisecondss = 1sec)
for (int i=1;i<=L;i++) //The loop. L times to blink.
{
_outp(addr,1); //Output is high in the first 'Data bit' of port(*), i.e Pin number 2 where you have connected the LED.
_sleep(freq); //freq mS delay between the high and low of LED.
_outp(addr,0); //Output is low now
_sleep(freq); //Pause again between the high,
}
return 0; //main returns nothing to you. ^_^
} // For an indepth look at
//(*)NOTE: There are some simple calculations to turn on/off the other PINs on the printer port.
//links
// http://msdn2.microsoft.com/en-us/library/733szwah.aspx _outp, _inp etc.
How input32.dll works:
http://logix4u.net/Parallel_Port/How...ll_works_.html
3. Assembly learning is somewhat a smooth ride if you stick with it. And it can be very very helpful. Speacially if you are planning on optimizing complex control instructions. It can be for Microcontrollers or your PP programming. That too, youll have to search...