Lab 1 To Lab 3
Lab 1 To Lab 3
1.1 Introduction:
The purpose of this experiment is to learn about the registers, instruction sets, data
transfer operation and logical operation of 8086 by using AND , OR in the given two 16 bit
numbers and store them in a memory location.
The logical AND instruction is used for masking off bits. The bits which have to be
cleared are to be AND ed with a logical zero and other bits are to be high.hence to achieve the
above objective,.AND with 0F0F .
The logical OR of a bit with procedure a result of 1.hence bits can be set selectively by
ORing the particular bit with a 1
1.4 Program
Introduction of general purpose registers,data transfer instruction, logical instruction
(AND,OR), immediate addressing, direct addressing:
Observation
Observation
1. Calculate the physical address for the given data. DS=1000h, BP=1234h
2. Initialise register CX to value FFFF and register AX to value 0000. Write a program to
exchange the content of both these registers.
3. Write a program to find the ones complement of FE27 and store it in memory location
1400.
4. What is the purpose of HLT instruction?
5. What happens if the result is greater than 16bit?
Lab 2
2.1 Introduction:
The purpose of this experiment is to learn about the registers, instruction sets, and
arithmetic operators of 8086 by addition , subtraction ,multiplication and division in the given
two 16 bit numbers and store them in a memory location.
Observation
IN PUT DATA OUT PUT DATA
ADDRESS ADDRESS
1100 1200
1101 1201
1102
1103
Observation
IN PUT DATA OUT PUT DATA
ADDRESS ADDRESS
1100 1200
1101 1201
1102
1103
Multiplication:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
MOV AX, [1100]
MOV BX, [1102]
MUL BX
MOV [1200],AX
MOV [1202],DX
HLT
Observation
Division:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
MOV AX, [1100]
MOV BX, [1102]
DIV BX
MOV [1200],AX
MOV [1202],DX
HLT
Observation
1. Write a program, which address a constant correction factor to a temp, that is stored in
the data segment. The corrected segment should be stored in a new location in memory.
2. The memory address starting from the logical address 0124h:0056h, store the numbers
0978h, CE45h, 45h and 7809h in consecutive locations. Draw a diagram showing the
physical address and the corresponding data stored
3. What is the instruction used for signed division?
4. Write a program to find the factorial of a number N. for 8086, the maximum size of an
operand for multiplication is only a word. This places a limitation on the value of N that
can be used. Hence the value of N is to be less than 9. Store the result in memory
5.List out the type of addressing modes used in your program
Lab 3
Ex.No.3.Program to demonstrate decision making and looping operation.
3.1 Introduction:
The purpose of this experiment is to learn about the general purpose registers, instruction
sets, addressing modes and logical operators of 8086 by sorting the sequence of numbers from
the array stored in a memory location into ascending and descending series.
To arrange the given numbers in ascending and descending order, the bubble sorting
method is used. Initially the first number of the series is compared with the second one. If the
first number is greater than second, exchange their positions in the series otherwise leave the
position unchanged. Then compare the second number in the recent form of the series with third
and repeat the exchange part that you are carried out for the first and second number, and for all
the remaining number of the series. Repeat this procedure for complete series (n-1) times. After
n-1 iterations you will get the largest number at the end of the series. Again start from the first
number of the series. Repeat the same procedure right from the first element to the last element.
After n-2 iteration you will get the second highest number at the last but one place in the series.
Repeat this till the complete series is arranged in ascending order.
3.4 Program:
Introduction of general purpose registers, logical operators, indirect addressing, and loop
instructions, compare instruction, exchange instruction, increment & decrement
instruction:
Ascending order:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
MOV SI,1200
MOV CL,[SI]
DEC CL
LOOP3 MOV SI,1200
MOV CH,[SI]
DEC CH
INC SI
LOOP2 MOV AL,[SI]
INC SI
CMP AL,[SI]
JC LOOP1
XCHG AL,[SI]
XCHG [SI-
1],AL
LOOP1 DEC CH
JNZ LOOP2
DEC CL
JNZ LOOP3
HLT
Descending order:
ADDRESS LABEL MNEMONICS OPCODE COMMENTS
MOV SI,1200
MOV CL,[SI]
DEC CL
LOOP3 MOV SI,1200
MOV CH,[SI]
DEC CH
INC SI
LOOP2 MOV AL,[SI]
INC SI
CMP AL,[SI]
JNC LOOP1
XCHG AL,[SI]
XCHG [SI-1],AL
LOOP1 DEC CH
JNZ LOOP2
DEC CL
JNZ LOOP3
HLT
Name :
Register No. :
Day / Session :
Venue :
Title of Experiment :
Date of Conduction :
Date of Submission :
Max. Marks
Particulars
Marks Obtained
Pre-lab 5
Lab Performance (Flow chart) 25
Post-lab 10
Total 40
Record 5
REPORT VERIFICATION
Date :
Staff Name :
Signature :