Question: 1 [20 Marks]

Suppose we have interfaced 2 different AC devices with our systemís parallel port and want those to be controlled using 2 different keyboard keys. You have to read and write the parallel portís data block using IN and OUT instructions.
Devices: Microwave
LCD
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 Key
Data pin linked
Device Controlled or Action Performed
M
Data Pin 0
Microwave Controlled
L
Data Pin 1
LCD Controlled
Q
NIL
Program Quit or Terminate
Table: 1





In your assembly 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 depend upon the current state.
For example :
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 ďMĒ to switch ON the Microwave then by pressing the key ďMĒ again will switch OFF the Microwave as shown in Table: 2.
You have to write a code in an assembly language using ASCII standard that take an input character from keyboard (Capital letters: M, L and Q) and on the basis of these characters, you have to control attached AC devices via the parallel port using IN and OUT instructions.

Key Pressed
D0
D1
D2
D3
D4
M
1
0
0
0
0
L
0
1
0
0
0
Q
0
0
0
0
0

Table: 2



Note : You will submit your code written in Word File.

Sponsored Links