Professional Documents
Culture Documents
Rajasthan 303007
LAB RECORD
CONTENTS & EVALUATION REPORT
Student Name: Vasudev Dwivedi Name of Laboratory: Microprocessors & Lab Code: EC2232
Microcontrollers Lab
S. Experiment Name Page Date of Attendance Record Performance Viva Total Signature
No. No. Allotment (1) (2) (3) (4) (10)
1. Introduction to 8086
2. WALP to add two 8-bit hexadecimal numbers available 1-4 01/03/21
in memory and store the result in the memory
3. WALP to perform subtraction of two 16-bit 5-8 08/03/21
hexadecimal numbers available in memory and store
the result in the memory.
4. WALP for converting an ASCII capital case alphabet 9-12 15/03/21
available in memory into small case alphabet. Store the
result at the same location in memory.
5. WALP to multiply two single ASCII digits available in 13-17 22/03/21
memory and store the result in unpacked BCD form in
memory.
6. WALP to perform division operation using two 8-bit 18-21 05/04/21
hexadecimal numbers available in memory and store
the result in the memory.
7. WALP to find the number of positive and negative data 22-26 12/04/21
elements present in a given array of ten signed
hexadecimal numbers stored in memory. Store the
count of positive and negative numbers in memory
Marks Obtained:
Name of Lab Instructor: Mr. Rohit Mathur Signature of Lab Instructor:
Page 1 of 2
LAB RECORD
CONTENTS & EVALUATION REPORT
Student Name: Vasudev Dwivedi Name of Laboratory: Microprocessors & Lab Code: EC2232
Microcontrollers Lab
S. Experiment Name Page Date of Attendance Record Performance Viva Total Signature
No. No. Allotment (1) (2) (3) (4) (10)
8. WALP to exchange corresponding elements of two data 27-31 19/04/21
blocks of length 10-bytes stored in memory starting
from 0102H and 010CH respectively. Using WHILE
structure.
9. WALP to search whether the number, 77h, is present in 32-36
the given data block or not. If it is present then, store 26/04/21
“1111h”, otherwise “ffffh” in DX. Using WHILE
structure.
10. WALP to find number of times letter ‘e’ appears in the 37-41 03/05/21
given string, ‘exercise’. Store the count in memory.
Using WHILE structure.
11. WALP to find smallest number from the ten elements 42-46 03/05/21
of a given array of 2-digit hex numbers. Using
SUBROUTINE.
12. Write a program to arrange the elements of a given 47-51 03/05/21
array of 8-bit hexadecimal numbers stored in the
memory in ascending order.
Page 2 of 2
EC2232
Microprocessors & Microcontrollers Lab
EXPERIMENT No. 2
(ADDITION)
AIM: WALP to add two 8-bit hexadecimal numbers available in memory and store
the result in the memory
PROGRAM:
Physical Data / Labels Mnemonics Operand(s) Comments:
Address OpCode i) Addressing Mode:
ii) Flags Affected:
org 100h Assembler Directive
07100 EB jmp start Transferred the control to start
07101 04 IF=1
Direct program addressing
sum
07109 8A mov al, [si] Addressing mode: indirect register
0710A 04
0710B 46 inc si Flags Affected: IF=1, PF=1
0710C 02 add al, [si] Addressing mode: indirect register
0710D 04 Flags Affected: IF=1, PF=1
0710E 46 ret
RESULT: Thus, an ALP to add two 8-bit hexadecimal numbers was written and executed
in emu8086.
EXPERIMENT No. 3
(SUBTRACTION)
PROGRAM:
Physical Data / Labels Mnemonics Operand(s) Comments:
Address OpCode i) Addressing Mode:
ii) Flags Affected:
org 100h
07100 EB jmp start Transferred the control to start
07101 08 IF=1
Direct program addressing
07012 36 vec1 1336h, 1124h, ?, Flags Affected: IF=1
07103 11 ?
07104 24
07105 11
07106 00 lea si, vec1 Addressing mode: immediate
Sub
07109 00 mov al, [si] Addressing mode: indirect register
0710A BE Flags Affected: IF=1
RESULT: Thus, an ALP to perform subtraction of two 16-bit hexadecimal was written and
executed in emu8086.
EXPERIMENT No. 4
(CASE CONVERSION)
AIM: WALP for converting an ASCII capital case alphabet available in memory into
small case alphabet. Store the result at the same location in memory.
PROGRAM:
Physical Data / Labels Mnemonics Operand(s) Comments:
Address OpCode i) Addressing Mode:
ii) Flags Affected:
org 100h Assembler Directive
07100 EB jmp start Transferred the control to start
07101 02 IF=1
Direct program addressing
07102 41 vec1 ‘A’, ?
07103 00
07104 BE lea si, vec1
07105 02 Addressing mode: immediate
07106 01 Flags Affected: IF=1
RESULT: Thus, an ALP for converting an ASCII capital case alphabet available in
memory into small case alphabet was written and executed in emu8086
EXPERIMENT No. 5
(MULTIPLICATION)
AIM: WALP to multiply two single ASCII digits available in memory and store the
result in unpacked BCD form in memory.
STOP
PROGRAM:
Physical Data / Labels Mnemonics Operand(s) Comments:
Address OpCode i) Addressing Mode:
ii) Flags Affected:
org 100h Assembler Directive
07100 EB jmp start Transferred the control to start
07101 04 IF=1
Direct program addressing
07102 32 vec1 '2','8', ?, ?
07103 38
07104 00
07105 00
07106 BE lea si,vec1 Addressing Mode: immediate
07107 02 Flags Affected: IF=1
07108 01
MULTI
RESULT: Thus, an ALP to multiply two single ASCII digits available in memory is written
and the result is stored in unpacked BCD form in memory.
EXPERIMENT No. 6
(DIVISION)
AIM: WALP to perform division operation using two 8-bit hexadecimal numbers
available in memory and store the result in the memory. (a>b)
PROGRAM:
Physical Data / Labels Mnemonics Operand(s) Comments:
Address OpCode i) Addressing Mode:
ii) Flags Affected:
07100 EB jmp start Transferred the control to start
07101 04 IF=1
Direct program addressing
07012 36 vec1 36h, 24h, ? , ?
07103 24
07104 00
07105 00
07106 BE lea si, vec1 Addressing Mode: immediate
07107 02 Flags Affected: IF=1
07108 01
divide
RESULT: Thus, an ALP to perform division operation using two 8-bit hexadecimal
numbers was written and executed in emu8086.
EXPERIMENT No. 7
(POSITIVE_NEGATIVE NUMBER SEARCH)
AIM: WALP to find the number of positive and negative data elements present in a
given array of ten signed hexadecimal numbers stored in memory. Store the
count of positive and negative numbers in memory. Using Repeat-Until
structure.
Use Sequence: 28h,9Eh,32h, 0ABh, 83h, 0A4h, 4fh, 68h, 12h, 72h.
No loop
done?
Yes
STOP
PROGRAM:
Physical Data / Labels Mnemonics Operand(s) Comments:
Address OpCode i) Addressing Mode:
ii) Flags Affected:
07100 EB jmp start Transferred the control to start
07101 0C IF=1
Direct program addressing
07106 83
07107 A4
07108 4F
07109 68
0710A 12
0710B 72
0710C 00
0710D 00
0710E B9 MOV CX, 0Ah Addressing Mode: immediate
0710F 0A Flags Affected: IF=1
07110 00
07111 BE LEA SI, vec1 Addressing Mode: immediate
07112 02 Flags Affected: IF=1
07113 01
REPEAT
07114 8A MOV AL, [SI] Addressing Mode: indirect register
07115 04 Flags Affected: IF=1
UNTIL
07120 46 INC SI Flags Affected: IF=1, PF=1
07121 E2 LOOP REPEAT Flags Affected: IF=1, PF=1
07122 F1
vi)
RESULT: Thus, an ALP to find the number of positive and negative data elements
present in a given array of ten signed hexadecimal numbers is written and
executed in emu8086.
EXPERIMENT No. 8
(EXCHANGE OPERATION)
AIM: WALP to exchange corresponding elements of two data blocks of length 10-
bytes stored in memory starting from 0102H and 010CH respectively.
Using WHILE structure. Use sequence:
Sequence1: 01Ah, 0B2h, 05h, 06h, 55h, 0CAh, 07h, 0FFh, 4Dh, 0E2H
Sequence2 :28h, 9Eh, 32h, 0ABh, 83h, 0A4h, 4Fh, 68h, 12h, 72h
increment pointers;
decrement counter
cl=0
STOP
PROGRAM:
Physical Data / Labels Mnemonics Operand(s) Comments:
Address OpCode i) Addressing Mode:
ii) Flags Affected:
07102 1A vec1 01Ah, Addressing Mode: immediate
07103 B2 0B2h, 05h,
07104 05 06h, 55h,
07105 06 0CAh,
07111 A4
07112 4F
07113 68
07114 12
07115 72
0711F 0C
07120 8A mov al, [si] Addressing Mode: register indirect
07121 04 Flags Affected: IF=1
EXPERIMENT No. 9
(SEARCHING OPERATION)
AIM: WALP to search whether the number, 77h, is present in the given data
block or not. If it is present then, store “1111h”, otherwise “ffffh” in DX.
Using WHILE structure. Use sequence:
Sequence-1: 0ABh, 23h, 0A5h, 0C3h, 0BEh, 0ACh, 097h.
Sequence-2: 0CDh, 57h, 79h, 22h, 0B1h, 77h, 057h.
increment pointers;
decrement counter
cl=0
STOP
PROGRAM:
Physical Data / Labels Mnemonics Operand(s) Comments:
Address OpCode i) Addressing Mode:
ii) Flags Affected:
07102 CD vec2 0CDh,
07103 57 57h, 79h,
07104 79 22h, 0B1h,
07106 B1
07107 77
07108 57
AGAIN
07111 74 jz NEXT2 Flags Affected: IF=1
07112 0E
07113 3A cmp al, [si] Addressing Mode: register indirect
07114 04 Flags Affected: CF=1, SF=1, OF=1,
PF=1, AF=1, IF=1
07115 74 jz NEXT1 Flags Affected: CF=1, SF=1, OF=1,
07116 05 PF=1, AF=1, IF=1
07117 46 inc si Flags Affected: CF=1, PF=1, IF=1
07118 FE dec cl Flags Affected: CF=1, PF=1, IF=1
07119 C9
0711A EB jmp AGAIN Flags Affected: CF=1, PF=1, IF=1
0711B F5
NEXT1
0711C DA mov dx, 1111h Addressing Mode: immediate
0711D 11 Flags Affected: ZF=1, PF=1, IF=1
0711E 11
0711F EB jmp STOP Flags Affected: ZF=1, PF=1, IF=1
07120 03
NEXT2
RESULT: Thus, ALP to search whether the number, 77h, is present in the given data
block or not. If it is present then, store “1111h”, otherwise “ffffh” in DX was
written and executed in emu8086.
EXPERIMENT No. 10
(SERACH OPERATION STRINGS)
AIM: WALP to find number of times letter ‘e’ appears in the given string,
‘exercise’. Store the count in memory. Using WHILE structure.
loop
done?
(CC=true) YES
STOP
PROGRAM:
Physical Data / Labels Mnemonics Operand(s) Comments:
Address OpCode i) Addressing Mode:
ii) Flags Affected:
07100 EB jmp start Transferred the control to start
07101 09 IF=1
Direct program addressing
07102 65 vec1
07103 78
07104 65
07105 72
07106 63
07107 69
07108 73
07109 65
0710A 00
0710B BE lea si, vec1 Addressing Mode: immediate
0710C 02 Flags Affected: IF=1
0710D 01
0710E FC cld Flags Affected: IF=1
0710F B1 mov Cl, 08h Addressing Mode: immediate
07110 08 Flags Affected: IF=1
07111 B0 mov al, ‘e’ Addressing Mode: immediate
07112 65 Flags Affected: IF=1
07113 74 jz NEXT2 Flags Affected: IF=1
07114 0D
07115 3A cmp al, [si] Flags Affected: IF=1, ZF=1, PF=1
07116 04
07117 74 jz NEXT1 Flags Affected: IF=1, ZF=1, PF=1
07118 05
07119 46 inc si Flags Affected: IF=1, PF=1
0711A FE dec cl Flags Affected: IF=1
0711B C9
0711C EB jmp again Flags Affected: IF=1, CF=1, PF=1
0711D F5
RESULT: Thus, an ALP to find number of times letter ‘e’ appears in the given string,
‘exercise’ was written and executed in emu8086.
EXPERIMENT No. 11
(SMALLEST NUMBER SEARCH)
AIM: WALP to find smallest number from the ten elements of a given array of 2-
digit hex numbers. Using SUBROUTINE. Use sequence:
Sequence-1: 0ABh, 23h, 0A5h, 0C3h, 0BEh, 0ACh, 097h, 79h, 22h, 0B1h.
Sequence-2: 0CDh, 10h, 79h, 0B1h, 77h, 057h, 0ABh, 23h, 22h, 01h.
loop
done?
STOP
PROGRAM:
Physical Data / Labels Mnemonics Operand(s) Comments:
Address OpCode i) Addressing Mode:
ii) Flags Affected:
07100 EB jmp Transferred the control to start
07101 15 IF=1
Direct program addressing
07106 BE 0ACh,
RESULT: Thus, an ALP to find smallest number from the ten elements of a given
array of 2-digit hex numbers was written and executed in emu8086.
EXPERIMENT No. 12
(SORTING OPERATION)
AIM: Write a program to arrange the elements of a given array of 8-bit hexadecimal
numbers stored in the memory in ascending order.
Use sequence: 0ABh, 23h, 0A5h, 0C3h, 0BEh, 0ACh, 097h, 79h, 22h, 0B1h
STOP
PROGRAM:
Physica Data / Label Mnemonics Operand(s) Comments:
l OpCode s i) Addressing Mode:
Addres ii) Flags Affected:
s
07100 C3 JMP start Transferred the control to start
07101 0A IF=1
Direct program addressing
07106 09
07107 00
07108 01
07109 02
0710A 05
0710B 07
0710C B1 MOV CL, 0Ah Addressing Mode: Immediate
0710D 0A Flags Affected: none
0710E FE DEC CL Flags Affected: IF=1
0710F C9
pass
07110 8A MOV BL, CL Addressing Mode: register
07111 D9 Flags Affected: PF=1, IF=1
07112 BE LEA SI, VEC1 Flags Affected: PF=1, IF=1
07113 02
07114 01
comp
07115 8A MOV AL, [SI] Addressing Mode: register indirect
07116 04 Flags Affected: PF=1, IF=1
07117 46 INC SI Flags Affected: PF=1, IF=1
07118 3A CMP AL, [SI] Addressing Mode: register indirect
07119 04 Flags Affected: CF=1, SF=1, PF=1,
AF=1, IF=1
0711A 72 JC L1 Flags Affected: CF=1, SF=1, PF=1,
0711B 06 AF=1, IF=1
0711C 86 XCHG AL, [SI] Addressing Mode: register indirect
0711D 04 Flags Affected: PF=1, IF=1
0711E 4E DEC SI Flags Affected: PF=1, IF=1
0711F 88
RESULT: Thus, a program to arrange the elements of a given array of 8-bit hexadecimal
numbers stored in the memory in ascending order is written and executed in
emu8086.