Microprocessor LabAssignment2
Microprocessor LabAssignment2
(UCS617) By
Submitted to
1
Experiment 1
Soln. -
MOV AX,1234H
MOV BX,1236H
ADD AX,BX
HLT
Output:
2
3
Experiment 2
Soln. -
MOV AX,1234H
MOV BX,1236H
SUB AX,BX
HLT
Output:
4
5
Experiment 3
Soln. -
MOV AX,[0301H]
MOV BX,[0303H]
MUL BX
HLT
Output:
6
7
Experiment 4
Soln. -
MOV AX,[0301H]
MOV BX,[0303H]
DIV BX
HLT
Output:
8
9
Experiment 5
Q. Write an assembly language program to demonstrate AAA, AAS, AAM, AAD, DAA and
DAS in 8086
Soln.
AAA AAS
AAA OR AL,0030H
HLT HLT
AAM AAD
MUL BL AAD
AAM DIV BX
OR AX,3030H HLT
HLT
10
DAA DAS
DAA DAS
HLT HLT
11
AAA Instruction
AAS Instruction
12
AAM Instruction
AAD Instruction
13
DAA Instruction
DAS Instruction
14
Experiment 6
Q. Write an assembly language program to find out the count of positive numbers and negative
Soln. -
MOV CL,0AH
MOV BL,00H
MOV DL,00H
LEA SI, [1000H]
L1: MOV AL, [SI]
SHL AL, 01
JNC L2
INC DL
JMP L3
L2: INC BL
L3: INC SI
DEC CL
JNZ L1
MOV [100AH], BL
MOV [100BH], DL
HLT
15
16
Experiment 7
Q. Write an assembly language program to convert to find out the largest number from a given
unordered array of 8-bit numbers, stored in the locations starting from a known address in 8086.
Soln. -
Output:-
17
18
Experiment 8
Q. Write an assembly language program to find out the largest number from a given
unordered array of 16-bit numbers, stored in the locations starting from a known address in
8086.
Soln. -
19
20
Experiment 9
Soln. -
MOV AL,00H
MOV SI,500H
MOV [SI],AL
ADD SI,01H
ADD AL,01H
MOV [SI],AL
MOV CX,[0000H]
SUB CX,0002H
L1:MOV AL,[SI-1]
ADD AL,[SI]
ADD SI,01H
MOV [SI],AL
LOOP L1
HLT
Output:
21
22
Experiment 10
Q. Write an assembly language program to perform the division 15/6 using the ASCII
codes. Store the ASCII codes of the result in register DX.
Soln. -
MOV AX,‟15‟
MOV BX, „6‟
SUB AX, 3030H
SUB BH, 30H
AAD
DIV BH
ADD AX, 3030H
MOV [SI ], AX
HLT
23
INDEX
Page 2
1. Interfacing ET-8255 study card with ET-8086 microprocessor hardware kit
(Excel Technologies)
Steps:
Step1. Connect the card to the kit through a 50-pin cable. Ensure that the pin-1 of the
card is connected to the pin-1 of the kit Bus connector. The Pin Nos. are marked in kit
and card.
Step2. Connect +5V and GND to the Kit and switch on the supply. If the Kit used is with
built in Power Supply, then +5V and Gnd are internally connected and one just needs to
switch on the power and Press Reset.
Step3. Select the SW2 switch in OFF position & Enter the program given below using
Sub MIR command if you want to enter in machine code or use Ex MEM command for
entering the program in Assembly language.
Step4. Execute the program using <GO> command The Program stops after the first V/O
Instruction. Observe the LED status as explained in the program below.
Step5. Press Swl one by one and observe the LED's status as explained in the program.
Command Table:
Page 3
10C BA 82 00 MOV DX, 82
Page 4
Fig 1.1: Output of the above program.
Page 5
2. Interfacing ET-8253 study card with ET-8086 microprocessor hardware kit
(Excel Technologies)
Steps:
Step1. Connect the card to the kit through a 50-pin cable. Ensure that the pin-1 of the
card is connected to the pin-1 of the kit Bus connector. The Pin Nos. are marked in kit
and card.
Step2. Connect +5V and GND to the Kit and switch on the supply. If the Kit used is with
built in Power Supply, then +5V and Gnd are internally connected and one just needs to
switch on the power and Press Reset.
Step3. Select the SW2 switch in OFF position & Enter the program given below using
Sub MIR command if you want to enter in machine code or use Ex MEM command for
entering the program in Assembly language.
Step4. Execute the program using <GO> command The Program stops after the first V/O
Instruction. Observe the LED status as explained in the program below.
Step5. Press Swl one by one and observe the LED's status as explained in the
observation. Observe square wave form on pin no.- 13 of 8253 or OUT1 Pin on the
card.
Command Table:
Page 6
10B EE OUT DX, AL WR, CS-ON, AO
& AI-OFF, WR*-
On
10C B0 00 MOV AL, 00 LOAD A0 as
MSB 00
Page 7
Fig 2.1: Output of the above program
Page 8
3. Interfacing ET-8279 study card with ET-8086 microprocessor hardware kit
(Excel Technologies)
Steps:
Step1. Connect the card to the kit through a 50-pin cable. Ensure that the pin-1 of the
card is connected to the pin-1 of the kit Bus connector. The Pin Nos. are marked in kit
and card.
Step2. Connect +5V and GND to the Kit and switch on the supply. If the Kit used is with
built in Power Supply, then +5V and Gnd are internally connected and one just needs to
switch on the power and Press Reset.
Step3. Select the SW2 switch in OFF position & Enter the program given below using
Sub MIR command if you want to enter in machine code or use Ex MEM command for
entering the program in Assembly language.
Step4. Execute the program using <GO> command The Program stops after the first V/O
Instruction. Observe the LED status as explained in the program below.
Step5. Press Swl one by one and observe the LED's status as explained in the
observation. Observe square wave form on pin no.- 13 of 8253 or OUT1 Pin on the
card.
Command Table:
Page 9
409 B0 87 MOV AL, 87 Command to write 87 on the data
8th display RAM display
location
Page 10
1302 25 Code For 2
Page 11
4. Interfacing ET-8251 study card with ET-8086 microprocessor hardware kit
(Excel Technologies)
Steps:
Step1. Connect the card to the kit through a 50-pin cable. Ensure that the pin-1 of the
card is connected to the pin-1 of the kit Bus connector. The Pin Nos. are marked in kit
and card.
Step2. Connect +5V and GND to the Kit and switch on the supply. If the Kit used is with
built in Power Supply, then +5V and Gnd are internally connected and one just needs to
switch on the power and Press Reset.
Step3. Select the SW2 switch in OFF position & Enter the program given below using
Sub MIR command if you want to enter in machine code or use Ex MEM command for
entering the program in Assembly language.
Step4. Execute the program using <GO> command The Program stops after the first V/O
Instruction. Observe the LED status as explained in the program below.
Step5. Press Swl one by one and observe the LED's status as explained in the
observation. Observe square wave form on pin no.- 13 of 8253 or OUT1 Pin on the card.
Command Table:
Page 12
010A 24 01 AND AL, 01
Page 13
5. Interfacing ET-8259 study card with ET-8086 microprocessor hardware kit (Excel
Technologies)
Steps:
Step1. Connect the card to the kit through a 50-pin cable. Ensure that the pin-1 of the
card is connected to the pin-1 of the kit Bus connector. The Pin Nos. are marked in kit
and card.
Step2. Connect +5V and GND to the Kit and switch on the supply. If the Kit used is with
built in Power Supply, then +5V and Gnd are internally connected and one just needs to
switch on the power and Press Reset.
Step3. Select the SW2 switch in OFF position & Enter the program given below using
Sub MIR command if you want to enter in machine code or use Ex MEM command for
entering the program in Assembly language.
Step4. Execute the program using <GO> command The Program stops after the first V/O
Instruction. Observe the LED status as explained in the program below.
Step5. Press Swl one by one and observe the LED's status as explained in the
observation. Observe square wave form on pin no.- 13 of 8253 or OUT1 Pin on the card.
Command Table:
Page 14
10C B0 91 MOV AL, 91 Give interrupt type to use
, for IR0-IR7=90-97
10E CD BE INT BE
Page 15
INE:
Page 16
Fig 5.1: Output of the above program
Page 17