Malp Lab Manual
Malp Lab Manual
Programming Lab
AMRAVATI.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
Vision:
To flourish as a centre of excellence for producing the skilled technocrats and committed
human beings.
Mission:
To create conducive environment for teaching &learning.
To impart quality education through demanding academic programs.
To enhance career opportunities by exposure to Industries &recent technologies.
To develop professionals with strong ethics and human values for the betterment of
society.
Vision
Mission
To create an ambiance that shall foster the growth for developing innovative
and entrepreneurial skills.
To identify areas of specialization upon which the department can concentrate,
thus promote academic growth and career opportunities.
To develop human resource with ethical and moral values for overall
personality development to serve the society.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
Core Competence To develop problem solving skills in to the graduates that are
required to analyse, design and implement solution with the computer
knowledge.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
Certificate
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
Name of Student
PRN No Roll No
Sign of
Title of the Date of Date of Assessment
SN. Page Teacher &
Practical / Experiment No Performance Submission Marks (15)
Remarks
Signature of Faculty
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
Teachers shall discuss the following points with students before start of practical of the
subject.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
Students shall read the points given below for understanding the theoretical concepts and practical applications.
1 Listen carefully to the lecture given by teacher about importance of subject, curriculum
philosophy, learning structure, skills to be developed, information about equipment,
instruments, procedure, method of continuous assessment, tentative plan of work in
laboratory and total amount of works to be done in a semester.
2 Student shall undergo study visit of the laboratory for types of equipment, and material
to be used, before performing experiments.
3 Read the write up of each experiment to be performed, a day in advance.
4
Organize the work in the group and make a record of all observations.
5
Understand the purpose of experiment and its practical implications.
6
Student should not hesitate to ask any difficulty faced during conduct of practical
/exercise.
7
Write the answers of the questions allotted by the teacher during practical hours if
possible or afterwards, but immediately.
8 The student shall study all the questions given in the laboratory manual and practice to
write the answers to these questions.
9 Student should develop the habit of pear discussion / group discussion related to
experiments / exercise so that exchanges of knowledge / skills could take place.
10 Students shall attempt to develop related hands-on-skills and gain confidence.
11 Student shall focus on development of skills rather than theoretical or codified
knowledge.
12 Student shall insist for the completions of recommended Laboratory Work, answers to
the given question etc.
13 Student shall develop the habit of evolving more ideas, innovations, skills etc. that
included in the scope of the manual.
14 Student shall refer technical magazines, proceedings of the Seminars, refer website
related to the scope of the subjects and update their knowledge and skills.
15 Student should develop the habit of not depend totally on teachers but to develop self
learning techniques.
16 Student should develop the habit to interact with the teacher without hesitation with
respect to academic involved.
17 Student should develop habit to submit the practical’s exercise continuously and
progressively on the schedule dates and should get the assessment done.
18 Student should be well prepared while submitting the write up of the exercise. This will
develop the continuity of the studies and he will not be overloaded at the end of the term.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
LABORATORY INSTRUCTIONS
Make entry in the Log Book as soon as you enter the Laboratory.
All the students should sit according to their Roll Numbers.
All the students are supposed to enter the terminal number in the Log Book.
Do not change the terminal on which you are working.
Strictly observe the instructions given by the Faculty / Lab. Instructor.
Take permission before entering in the lab and keep your belongings in the racks.
NO FOOD, DRINK, IN ANY FORM is allowed in the lab.
TURN OFF CELL PHONES! If you need to use it, please keep it in bags.
Avoid all horseplay in the laboratory. Do not misbehave in the computer laboratory. Work
quietly.
Save often and keep your files organized.
Don’t change settings and surf safely.
Do not reboot, turn off, or move any workstation or PC.
Do not load any software on any lab computer (without prior permission of Faculty and
Technical Support Personnel). Only Lab Operators and Technical Support Personnel are
authorized to carry out these tasks.
Do not reconfigure the cabling/equipment without prior permission.
Do not play games on systems.
Turn off the machine once you are done using it.
Violation of the above rules and etiquette guidelines will result in disciplinary action.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
SN List of Practical
1 To implement adder for two 8-bit and 16 bit numbers.
2 To implement subtractor for two 8-bit and 16 bit numbers.
3 To implement multiplier for two 8-bit and 16 bit numbers
4 To implement divider for two 8-bit and 16 bit numbers.
5 Write an ALP to exchange two 8-bit numbers using XCHG instruction, using third
register and without using third register.
6 Develop and execute ALP to increment and decrement two 8-bit numbers.
7 Write an ALP to find out the cube of 8 bit number using mul instruction
8 Write an ALP to shift the 8-bit number towards left and towards right.
9 Write a program to calculate sum of array.
10 Write a program to count number of zeroes and ones in a given 8 bit number.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
Course Objectives: In this lab, student will learn about “Microprocessor and interfacing” in regards to digital
computer, microprocessor architecture, programming with 8086 microprocessor and different peripherals.
Course Outcomes: After successful completion of lab course, the students will able to
3. Design and test Assembly Language Programs using 8086 microprocessor instruction set.
4. Demonstrate the implementation of standard programming constructs, including control structures and
functions, in Assembly Language.
5. Illustrate and realize the Interfacing of memory & I/O devices with 8086 microprocessor.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
Allocated
Parameters High Medium Low
Marks
Student answered Student did not
Student answered
only few prelab answer any prelab
all the prelab
questions and question and not
questions and
Prelab test partial know aware about
2 Objective of the
objective of the objective of the
experiment.
experiment. experiment
2 1 0
Student performed
Student performed
or executed Student performed
or executed
experiment, or executed
experiment,
obtained results, experiment, obtained
obtained results,
In-Lab and drawn results, and drawn
5 and drawn
performance conclusion conclusion below
conclusion fully as
partially as per the expectation.
per expectation.
expectation.
5 4-3 2-1
Student partially
Student answered Student did not
answered the Post
the Post lab Viva answer the Post lab
lab Viva voce
voce questions and Viva voce questions
questions and
Post lab test fully confirms the and not confirms the
3 partially confirms
understanding of understanding of the
the understanding
the experiments. experiments.
of the experiments.
3 2-1 0
Records submitted Records submitted Records submitted
by the Student by the Student by the Student found
found highly found moderately highly
Lab Record
5 satisfactory after satisfactory after dissatisfactory after
evaluation. evaluation. evaluation.
5 4-3 2-1
Total Marks 15 Marks (Continuous Assessment)
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
Allocated
Parameters High Medium Low
Marks
Students able to Student partially able to Student not able to
conduct the given conduct the given conduct given
experiment with experiment with desired experiment with
Performance 5 desired output. output. desired output.
5-4 3-1 0
Student answered the Student answered the
Student did not answer
Questions Questions moderately
Viva Voce 5 satisfactorily. satisfactorily. the Questions.
5-4 3-1 0
Total marks 10 Marks (Internal Examination)
Grand Total Marks Continues Assessment (15)+Internal Examination (10) =25 Marks
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PRACTICAL NO. 01
AIM : To implement adder for two 8-bit and 16-bit numbers.
1. Start
2. Read two 8 bit numbers
3. Add two 8 bit numbers
4. Stop
FLOWCHART:
Start
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
ALGORITHM:
1. Start
2. Read two 16 bit numbers
3. Add two 16 bit numbers
4. Stop
FLOWCHART:
Start
Stop
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DW 0008H
NUM2 DW 0002H
.CODE
CONCLUSION: Hence, we have successfully implemented adder for two 8-bit and 16 bit numbers.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
1 What is Microprocessor?
4 What is ALU?
2 What is BIU?
3 What is EU?
ASSESSMENT SCHEME:
Signature of Faculty
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PRACTICAL NO. 02
AIM : To implement Subtractor for two 8-bit and16-bit number
1. Start
2. Read two 8 bit numbers
3. Subtract two 8 bit numbers
4. Stop
FLOWCHART:
Start
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
ALGORITHM:
1. Start
2. Read 16-bit number
3. Subtract two 16 bit numbers
4. Stop
FLOWCHART:
Start
Stop
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DW 0008H
NUM2 DW 0002H
.CODE
CONCLUSION: Hence, we have successfully implemented Subtractor for two 8-bit and 16 bit numbers.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
1 Define Pipelining in µp ?
3 What is INTR ?
1 What is NMI?
3 What is Queue?
4 What is Stack?
ASSESSMENT SCHEME:
Signature of Faculty
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PRACTICAL NO. 03
AIM : To implement multiplier for two 8 bit and 16-bit numbers.
1. Start
2. Read two 8 bit numbers
3. Multiply two 8 bit numbers
4. Stop
FLOWCHART:
Start
Stop
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DB 08H
NUM2 DB 02H
.CODE
MOV AX, @DATA
MOV DS, AX
MOV AL, NUM1
MOV BL, NUM2
MUL BL
MOV AH, 4CH
INT 21H
END
RESULT:
AX=0010H
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
ALGORITHM:
1. Start
2. Read two 16 bit numbers
3. Multiply two 16 bit numbers
4. Stop
FLOWCHART:
Start
Stop
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DW 0008H
NUM2 DW 0002H
.CODE
CONCLUSION: Hence, we have successfully implemented Multiplier for two 8-bit and 16 bit numbers.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
4 What is MALP?
4 What is an OPCODE?
ASSESSMENT SCHEME:
Signature of Faculty
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PRACTICAL NO. 03
(Division of 16-bit by 8-bit number)
ALGORITHM:
1. Start
2. Read 16-bit and 8 bit number
3. Divide 16-bit by 8 bit number
4. Stop
FLOWCHART :
Start
Stop
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DW 0008H
NUM2 DB 02H
.CODE
MOV AX,@DATA
MOV DS, AX
MOV AX, NUM1
MOV BL, NUM2
DIV BL
MOV AH, 4CH
INT 21H
END
RESULT: 0004H
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
LIST OF PRE-LAB QUESTIONS:
2 Which is ROL?
3 What is ROR?
4 What is Software?
5 What is Hardware?
1 What is DB?
2 What is DW?
3 What is DD?
4 What is DQ?
5 What is DT?
ASSESSMENT SCHEME:
Signature of Faculty
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PRACTICAL NO. 05
AIM: Write an ALP to exchange two 8-bit numbers using XCHG instruction, third register and without using
third register.
Practical no. 5(A) (exchange of two 8-bit numbers using XCHG instruction)
ALGORITHM:
1. Start
2. Read two 8 bit numbers
3. Exchange two 8 bit numbers
4. Stop
FLOWCHART:
Start
Stop
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DB 06H
NUM2 DB 04H
.CODE
MOV AX,
@DATA MOV DS,
AX MOV AL,
NUM1 MOV BL,
NUM2 XCHG AL,
BL MOV AH, 4CH
INT 21H
END
Practical no. 5(B) (exchange of two 8-bit numbers using third register)
ALGORITHM:
1. Start
2. Read two 8 bit numbers
3. Move the contents of 1st register to 3rd register.
4. Move the contents of 2nd register to 1st register.
5. Move the contents of 3rd register to 2nd register.
6. Stop
FLOWCHART:
Start
Stop
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DB 08H
NUM2 DB 02H
.CODE
MOV AX, @DATA
MOV DS, AX
MOV AL, NUM1
MOV BL, NUM2
MOV CL, AL
MOV AL, BL
MOV BL, CL
MOV AH, 4CH
INT 21 H
END
RESULT: Before swapping : AL=06H, BL=04H
After swapping : AL=04H, BL=06H
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
Practical no. 5(C) (exchange of two 8-bit numbers without using third register
& XCHG instruction)
ALGORITHM:
1. Start
2. Read two 8 bit numbers
3. Add two 8-bit numbers.
4. Subtract sum from 2nd number.
5. Correct the result.
6. Subtract corrected result from sum.
7. Stop
FLOWCHART:
Start
Stop
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DB 06H
NUM2 DB 04H
.CODE
MOV AX, @DATA
MOV DS, AX
MOV AL, NUM1
MOV BL, NUM2
ADD AL, BL
SUB BL, AL
NEG BL
SUB AL, BL
MOV AH, 4CH
INT 21 H
END
CONCLUSION: Hence, we have successfully executed ALP to exchange two 8-bit numbers using XCHG
instruction, third register and without using third register.
.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
2 Which is an instruction?
3 Explain Assembler?
ASSESSMENT SCHEME:
Signature of Faculty
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PRACTICAL NO. 06
AIM : Develop and Execute Assembly Language Program to increment & decrement of two 8-bit numbers.
ALGORITHM:
1. Start
2. Read two 8 bit numbers
3. Increment & Decrement of two 8- bit numbers
4. Stop
FLOWCHART:
Start
PROGRAM: Stop
.MODEL SMALL
.DATA
NUM1 DB 09H
NUM2 DB 05H
.CODE
MOV AX, @DATA
MOV DS, AX
MOV AL, NUM1
INC AL
MOV BL, NUM2
DEC BL
MOV AH, 4CH
INT 21H
END
RESULT: AL=OAH
BL=04H
CONCLUSION: Hence, we have successfully developed and execute Assembly Language Program to increment
& decrement of two 8-bit numbers.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
4 What is Operand?
1 What is Microcontroller?
2 What is Microcomputer?
ASSESSMENT SCHEME:
Signature of Faculty
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PRACTICAL NO. 07
AIM : Write an ALP for 8086 to find cube of 8 bit number using MUL instruction.
Stop
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DB 02H
.CODE
MOV AX, @DATA
MOV DS, AX
MOV AL, NUM1
MOV BL, AL
MUL AL
MUL BL
MOV AH, 4CH
INT 21H
END
RESULT: AL=O8H
CONCLUSION: Hence, we have successfully developed and execute Assembly Language Program to increment
& decrement of two 8-bit numbers.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
1 What is carry?
4 What is Bus?
5 What is LEA?
ASSESSMENT SCHEME:
Signature of Faculty
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PRACTICAL NO. 08
AIM : Write an ALP to shift the 8-bit number towards left and towards right.
ALGORITHM:
1. Start
2. Read a 8 bit numbers
3. Shift the number towards left by 1 bit position.
4. Stop
FLOWCHART:
Start
Stop
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DB 28H
.CODE
MOV AX, @DATA
MOV DS, AX
MOV AL, NUM1
SHL AL, 01H
MOV AH, 4CH
INT 21H
END
RESULT: AL=50H
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
ALGORITHM:
5. Start
6. Read a 8 bit numbers
7. Rotate the number towards right by 1 bit position.
8. Stop
FLOWCHART:
Start
Stop
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DB 28H
.CODE
MOV AX, @DATA
MOV DS, AX
MOV AL, NUM1
SHR AL, 01H
MOV AH, 4CH
INT 21H
END
RESULT: AL=14H
CONCLUSION: Hence, we have successfully executed ALP to shift the 8-bit number towards left and
towards right
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
3 Explain SHL?
4 What is SHR?
5 Explain INTA?
2 What is DMA?
ASSESSMENT SCHEME:
Signature of Faculty
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PRACTICAL NO. 09
AIM : Write an ALP to determine sum of array elements.
ALGORITHM:
1. Start
2. Read the Array elements.
3. Load the array length to CL (counter).
4. Load effective address of array in BX.
5. Move 00 to AH and AL registers.
6. Specify label(loop) to perform addition
7. Add the AL and current value of BX.
8. Increment the BX by 1.
9. Decrement CL by 1
10. Compare the Counter CL with 00.
11. Jump if counter is not zero to label.
12. Iterate the loop until counter is ‘0’.
13. Stop
FLOWCHART:
Start
False
Increment BX by 1
Decrement counter CL by 1
Compare Cl=0
True
Stop
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PROGRAM:
.MODEL SMALL
.DATA
A DB 1H, 2H, 3H, 4H, 5H
.CODE
MOV AX, @DATA
MOV DS, AX
MOV CL, 05H
LEA BX, A
MOV AH, 00H
MOV AL, 00H
L1: ADD AL, BYTE PTR[BX]
INC BX
DEC CL
CMP CL, 00H
JNZ L1
MOV AH, 4CH
INT 21H
END
RESULT: AX = 000FH
CONCLUSION: Hence, we have successfully executed ALP to perform sum of array elements.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
1 What is Macros?
2 Which is Procedures?
3 Explain Subroutine?
ASSESSMENT SCHEME:
Signature of Faculty
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PRACTICAL NO. 10
ALGORITHM:
1. Start
2. Read a 8-bit unsigned numbers.
3. Rotate the number towards right by 1 bit position
4. Check the carry flag, if it is set the increment BX by 1
5. If the carry flag is rest then execute the loop.
6. Stop
FLOWCHART:
Start
Yes No
If CF=1
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
PROGRAM:
.MODEL SMALL
.DATA
NUM1 DB 32H
.CODE
MOV AX, @DATA
MOV DS, AX
MOV CL, 08H
MOV BL, 00H
MOV AL, NUM1
UP : ROL
AL,01H
JNZ EXIT
INC BL
NEXT: LOOP UP
MOV AH, 4CH
INT 21H
END
RESULT: BX=00O3H
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
10(B) (to count number of zeros)
c
Read a 8 bit number
o
Rotate the 8 bit number by 1
u
n
t
n Yes No
u If CF=0
m
b
e Stop Execute the loop
r
Increment BL by 1
o
f
z
e
r
o
s
)
PROGRAM:
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
.MODEL SMALL
.DATA
NUM1 DB 32H
.CODE
MOV AX, @DATA
MOV DS, AX
MOV CL, 08H
MOV BL, 00H
MOV AL, NUM1
UP : ROL
AL,01H
JNZ EXIT
RESULT: INC BL
NEXT: LOOP UP
MOV AH, 4CH
INT 21H
END
0005H
CONCLUSION: Hence, we have successfully executed a program to find Greatest of two 8-bit
unsigned numbers.
PRPCEM, Amravati
Microprocessor & Assembly Language
Programming Lab
3 What is Accumulator?
4 What is linker?
ASSESSMENT SCHEME:
Signature of Faculty
PRPCEM, Amravati