Posted by : Anonymous Sunday, 6 January 2013


Question: 1
In this assignment, you have to deal with parallel ports as shown in Fig: 1.You have to read and write the parallel port’s data block using IN and OUT instructions.
We can control AC devices (switching them ON/OFF) by interfacing them with system’s Parallel Port as shown in Fig: 2.We have to use some external Electrical switching circuitry which needs some expertise to design it that will switch those devices ON or OFF depending upon the Parallel Port’s PIN status either Set (1) or Cleared (0).

Fig: 2




Suppose we have interfaced 5 different AC devices with our system’s parallel port and want those to be controlled using five different keyboard keys.
You have to write an assembly code that will read the device status (read the parallel port) and on the basis of that status, it will turn the specific device ON or OFF depending upon your input provided through keyboard as shown in Table: 1.
Keyboard KeyData pin linkedDevice Controlled or Action Performed
FData Pin 0FAN Controlled
LData Pin 1Light Controlled
TData Pin 2Television Controlled
DData Pin 3DVD player Controlled
SData Pin 4Sound System Controlled
QNILProgram Exit/Quit/Terminate

Table: 1
In your code, you have to read an input character (ASCII code only) from keyboard and then have to send a specific HEX value to parallel port to turn ON or OFF the specific device (depends upon the current state).
Note: If a device is ON, by pressing the assigned key the device should be set to OFF or vice versa. For example, if you have pressed “F” to switch ON the FAN then by pressing the key “F” again will switch OFF the FAN as shown in Table: 2.
You have to write a code in assembly language using ASCII standard that take an input character from keyboard (Capital letters:F, L, T, D, S and Q) and on the basis of these characters, you have to control attached AC devices via the parallel port.

Key PressedD0D1D2D3D4
F1



L
1


T

1

D


1
S



1
Q




Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © virtual university of pakistan - Skyblue - Powered by Blogger - Designed by Johanes Djogan -