21
Parallel Port Interfacing using Assembly Language

Parallel Port Interfacing using Assembly Language

Embed Size (px)

Citation preview

Page 1: Parallel Port Interfacing using Assembly Language

Parallel Port Interfacing using Assembly

Language

Parallel Port Interfacing using Assembly

Language

Page 2: Parallel Port Interfacing using Assembly Language

Computer port (hardware)

• A 'port' serves as an interface between the computer and other computers or peripheral devices.• A port is a specialized outlet on a

piece of equipment to which a plug or cable connects.

Page 3: Parallel Port Interfacing using Assembly Language

Example ports

USB

Page 4: Parallel Port Interfacing using Assembly Language

Example ports

FireWire

Page 5: Parallel Port Interfacing using Assembly Language

Example ports

Ethernet port

Page 6: Parallel Port Interfacing using Assembly Language

Example ports

Serial Port

Page 7: Parallel Port Interfacing using Assembly Language

Example ports

Parallel Port

Page 8: Parallel Port Interfacing using Assembly Language

Example ports

PS/2 Connector

Page 9: Parallel Port Interfacing using Assembly Language

Example ports

VGA Connector

Page 10: Parallel Port Interfacing using Assembly Language

Electrical signal transfer

Electronically, hardware ports can almost always be divided into two groups based on the signal transfer:•Serial ports send and receive one bit at a time via a single wire pair (Ground and +/-).•Parallel ports send multiple bits at the same time over several sets of wires.

Page 11: Parallel Port Interfacing using Assembly Language

Electrical signal transfer

Page 12: Parallel Port Interfacing using Assembly Language

Parallel PortParallel Port

• a type of interface found on computers for connecting various for connecting various peripheralsperipherals. . • is a parallel communicationparallel communication physical

interface.• is also known as a printer portprinter port

Page 13: Parallel Port Interfacing using Assembly Language

Parallel Port AddressesParallel Port Addresses

PORT Name PORT AddressLPT1 0x3BC (956)LPT2 0x378 (888)LPT3 0x278 (632)

When the computer is first turned on, BIOS (Basic Input/Output System) will determine the number of ports you have and assign device labels LPT1, LPT2 & LPT3 to them. Usually the address for LPT1 is 378h.

Page 14: Parallel Port Interfacing using Assembly Language

Parallel Port AddressesParallel Port Addresses

To know your Parallel Port address, do the following:Go to Start > Control Panel > System > ‘Hardware’ Tab > Click on Device Manager > Look for ‘Ports’ in the device list > Double click on LPT1 > Click on the ‘Resources’ Tab. In that you can see the starting address of I/O Range.

Page 15: Parallel Port Interfacing using Assembly Language

Parallel Port PinsParallel Port Pins

Page 16: Parallel Port Interfacing using Assembly Language

Circuit DiagramCircuit Diagram

Page 17: Parallel Port Interfacing using Assembly Language

CPU ModesCPU Modes

Kernel ModeIn Kernel mode, the executing code has complete and unrestricted access to the underlying hardware.User ModeIn User mode, the executing code has no ability to directly access hardware or reference memory.

Page 18: Parallel Port Interfacing using Assembly Language

User Port DriverUser Port Driver

• is a kernel mode driver for Windows NT/2000/XP/Vista/Win7 that gives usermode programs access to I/O ports.

• from Tomas Franzon.

Download Site:http://hem.passagen.se/tomasf/

UserPort/UserPort.zip

Page 19: Parallel Port Interfacing using Assembly Language

UserPort InstallationUserPort Installation

• Copy UserPort.SYS to %WINDIR%\SYSTEM32\DRIVERS

• Start UserPort.EXE• add the addresses you want and remove

the others• click on start

Page 20: Parallel Port Interfacing using Assembly Language

ProgrammingProgramming

.model tiny

.codemain: mov al, 00000001b mov dx, 378h out dx, al mov ax, 4c00h int 21hend main

Page 21: Parallel Port Interfacing using Assembly Language