2009
Assembly Language Lab #9 Lab 9 Parallel Port Interfacing Applications Background: Parallel Part
A parallel port is a type of socket found on personal computers for interfacing with various peripherals. It is also known as a printer port or Centronics port (this name came from a popular printer manufacturing company 'Centronics' who devised some standards for parallel port). PC parallel port can be very useful I/O channel for connecting your own circuits to PC. PC parallel port is 25 pin D-shaped female connector in the back of the computer. Not all 25 are needed always. Usually you can easily do with only 8 output pins (data lines) and signal ground.
The original IBM-PCs parallel port had a total of 12 digital outputs and 5 digital inputs accessed via 3 consecuve 8-bit ports in the processors I/O space.
66
D.
67
dosseg .model small .code start: call test jmp start test: push cx push ax push dx mov ah,06 mov dl,0ffh int 21h cmp al,27 je exit cmp al,'1' je right cmp al,'2' je left cmp al,'0' je off pop dx
68
Part2: Connect 8 LEDs as in part 1 and connect a switch as shown in the following figure Write an assembly language program that does the following a. When switch is ON LEDs lights ON b. When switch is OFF LEDs lights OFF
69
x1:
light: end1:
end:
dosseg .model small .code mov dx,379h in al,dx and al,00001000b cmp al,08H je light mov al,00000000b jmp end1 mov al,11111111b mov dx,378H out dx,al jmp x1 mov ah,4ch int 21h END
70