Tutorial 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

KATHMANDU School of Engineering

UNIVERSITY Department of Electrical & Electronics Engineering


MICROPROCESSOR TUTORIAL1
To be submitted till 7th November 2019

1. What is the task of the following program? Specify the contents of flags, registers used
and output port 30H after the execution of the following instructions.
1200: MVI A, 55H
1202: ANI 80H
1204: JNZ 120DH
1207: OUT 30H
120A: JMP 1212H
120D: MVI A, 01H
120F: OUT 30H
1212: HLT
2. Write a program to load two unsigned numbers in register B and register C respectively.
Subtract the content of C from content of B. If the result is 2’s complement convert the
result in absolute magnitude and display it at output port 40H otherwise display the
result.

3. Write a program for absolute division of two numbers. Assume that the numbers are in
register B and C, and the result is to be displayed at output device 50H.

4. Write a program to load the bit pattern 91H in register B and 87H in register C, mask all
the bits except D0 from registers B and C, and if D0 is at logic 1 in both the registers, turn
on the light connected to the D0 position of the output port 01H; otherwise, turn off the
light.

5. A microprocessor based temperature control system is shown below. The light detectors
receive the light when reflected by the mercury level in the thermometer and sends ‘1’ to
the input port (30H). Depending on the input signal the microprocessor is to operate the
fan, heater or the indicators. The fan is to operate for temperature above 20 degree, with
different speed, depending upon the temperature level. The microprocessor is to operate
the resistances accordingly. The heater is to be operated below 16 degree with the heating
coils being on depending on temperature. If the temperature is in the range of 16 to 20
degrees both the fan and heater is to be put off and the Green LED is turned ON. If the
temperature is below 4 degree or above 28 degree the Red LED is to be turned ON with
fan or heater. Write a program for the proper operation of the system and explain the
execution flow.
6. The figure below uses an 8085 based system to track the sun, and position the Solar
Photovoltaic module in the direction of the sun. The solar module is attached to a DC
motor and the sun is tracked by two light sensors at two sides of the solar photovoltaic
module. If both the sensor sends ‘1’ the motor is to be stopped. If only sensor1 sends ‘1’
the motor is to be rotated in one direction and if only sensor2 sends ‘1’ the motor is to be
rotated in the other direction. For a DC motor “10” at the supply pins rotates the motor in
one direction and “01” rotates the motor in the other direction. As per the connection
shown on the right, write a program for the proper operation of the system.

D7 Sensor 1
Input D6
Sun (30H) D5 Sensor 2
8 D4
0 System bus D3
Direct solar radiation 8086
8 D2
Octal
5 D1
Buffer D0
Sensor 1

D7
Output D6
(31H) D5
D4
Sensor 2 M Motor D3
Octal D2
Latch D1 Motor2
D0 Motor1

You might also like