Micro Processor LAB Manual

23
DEPARTMENT OF COMPUTER SCIENCE AND ENGG. LAB MANUAL Name of Student : ……………………………………….. Name of Lab : MICROPROCESSOR AND INTERFACING Subject Code : CS-601 Branch: C.S. & ENGG. Year/Sem: III/VI MAHAKAL INSTITUTE OF TECHNOLOGY BEHIND AIR STRIP UJJAIN (MP) Approved By All India Council of Technical Education (New Delhi)

Transcript of Micro Processor LAB Manual

Page 1: Micro Processor LAB Manual

DEPARTMENT OFCOMPUTER SCIENCE AND ENGG.

LAB MANUAL

Name of Student: ………………………………………..

Name of Lab: MICROPROCESSOR AND INTERFACING

Subject Code: CS-601

Branch: C.S. & ENGG.

Year/Sem: III/VI

Affiliated to Rajiv Gandhi Prodyogiki VishwavidyalayaBhopal (MP)

MAHAKAL INSTITUTE OF TECHNOLOGYBEHIND AIR STRIP UJJAIN (MP)

Approved By All India Council of Technical Education (New Delhi)

Page 2: Micro Processor LAB Manual

INDEXS.No Name of Algorithm Date of

SubmissionSIGN REMARK

1. Write an assembly language program to

subtract two 16-bit numbers.

2. Write an assembly language program to add

two 8-bit numbers.

3. Write an assembly language program to

multiply two 16-bit numbers.

4. Write an assembly language program to

swap two variables without using third

variable.

5. Write an assembly language program for

addition of two 64-bit numbers

6 Write an assembly language program for

division of two 16-bit numbers using

successive subtraction

7. Write an assembly language program for

division of two 16-bit numbers using

successive addition.

8. Write an assembly language program for

finding division of two 16-bit numbers

9. Write an assembly language program for

finding average of 5 numbers in the array..

10. Write an assembly language program for

finding sum of first n natural numbers.

11. Write an assembly language program for

printing n even numbers

12. Write an assembly language program for

printing n odd numbers.

Page 3: Micro Processor LAB Manual

S.No Name of Algorithm Date of Submission

SIGN REMARK

13 Write an assembly language program to find

largest between 2 numbers

14 Write an assembly language program to

calculate factorial of a given number.

Page 4: Micro Processor LAB Manual

List of the Experiments

Microprocessor & Interfacing

1. Write an assembly language program to subtract two 16-bit numbers

2. Write an assembly language program to add two 16-bit numbers

3. Write an assembly language program to multiply two 16-bit numbers

4. Write an assembly language program to swap two variables without using

third variable.

5. Write an assembly language program for addition of two 64-bit numbers

6. Write an assembly language program for division of two 16-bit numbers

using successive subtraction.

7. Write an assembly language program for division of two 16-bit numbers

using successive addition.

8. Write an assembly language program for finding division of two 16-bit

numbers.

9. Write an assembly language program for finding average of 5 numbers in the

array.

10. Write an assembly language program for finding sum of first n natural

numbers

11. Write an assembly language program for printing n even numbers

12. Write an assembly language program for printing n odd numbers.

13. Write an assembly language program to find largest between 2 numbers.

14. Write an assembly language program to calculate factorial of a given

number.

Page 5: Micro Processor LAB Manual

PROGRAM NO: - 1Unit/Topic: 1/8086Programming

Problem Definition:

Write an assembly language program to subtract two 16-bit numbers.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare data in DATA SEGMENT. Write code in CODE SEGMENT. Move number in appropriate segment. Subtract the value of 2 registers by SUB instruction.

Input Set:

Output Set:

Notes:

Page 6: Micro Processor LAB Manual

PROGRAM NO: - 2Unit/Topic: 1/8086Programming

Problem Definition:

Write an assembly language program to Add two 8-bit numbers.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare data in DATA SEGMENT. Write code in CODE SEGMENT. Move number in appropriate segment. Add the value of 2 registers by ADD instruction.

Input Set:

Output Set:

Notes:

Page 7: Micro Processor LAB Manual

PROGRAM NO: - 3Unit/Topic: 1/8086Programming

Problem Definition:

Write an assembly language program to Multiply two 16-bit numbers.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Specify the default register Move the value of the word 1 to AX. Move the value of the word 2 to BX. Multiply the value of the AX and BX. Move the memory location to the Destination Index. Move the value of AX into DI..

Input Set:

Output Set:

Notes:

Page 8: Micro Processor LAB Manual

PROGRAM NO: - 4Unit/Topic: 1/8086Programming

Problem Definition:

Write an assembly language program to swap two variables without using third

variable.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Add the value of reg1 to reg2. Sub the value of reg2 from reg1. Negate the value of reg2. Sub the value of reg1 from reg2.

Input Set:

Output Set:

Notes:

Page 9: Micro Processor LAB Manual

PROGRAM NO: - 5Unit/Topic: 1/8086 Programming

Problem Definition:

Write an assembly language program for addition of two 64-bit numbers.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare the Data in DATA SEGMENT. Write Code in CODE SEGMENT. Move number in appropriate segment. Declare a label START. Move D1 to AX and D2 to BX Increment the values of S1 and DI two times. Subtract the values of 2 registers by SUB Instruction.

Input Set:

Output Set:

Notes:

Page 10: Micro Processor LAB Manual

PROGRAM NO: - 6Unit/Topic: 1/8086 Programming

Problem Definition:

Write an assembly language program for division of two 16-bit numbers using

successive subtraction.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare the Data in DATA SEGMENT. Write Code in CODE SEGMENT. Declare a label START. Move number in appropriate segment.

Input Set:

Output Set:

Notes:

Page 11: Micro Processor LAB Manual

PROGRAM NO: - 7Unit/Topic: 1/8086 Programming

Problem Definition:

Write an assembly language program for division of two 16-bit numbers using

successive addition.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare the Data in DATA SEGMENT. Write Code in CODE SEGMENT. Declare a label START. Move number in appropriate segment.

Input Set:

Output Set:

Notes:

Page 12: Micro Processor LAB Manual

PROGRAM NO: - 8Unit/Topic: 1/8086 Programming

Problem Definition:

Write an assembly language program for finding division of two 16-bit numbers.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare the Data in DATA SEGMENT. Write Code in CODE SEGMENT. Move number in appropriate segment. Divide the value of AX by value of BX.

Input Set:

Output Set:

Notes:

Page 13: Micro Processor LAB Manual

PROGRAM NO: - 9Unit/Topic: 1/8086 Programming

Problem Definition:

Write an assembly language program for finding average of 5 numbers in the array.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare the Data in DATA SEGMENT. Write Code in CODE SEGMENT. Declare a label NEXT. Increment values of SI 2 times. Divide the value of AX by value of BX.

Input Set:

Output Set:

Notes:

Page 14: Micro Processor LAB Manual

PROGRAM NO: - 10Unit/Topic: 1/8086 Programming

Problem Definition:

Write an assembly language program for finding sum of first n natural numbers.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare the Data in DATA SEGMENT. Write Code in CODE SEGMENT. Declare a label NEXT. Add the value of AX and BX. Decrement the value BX. Move the number in appropriate segment.

Input Set:

Output Set:

Notes:

Page 15: Micro Processor LAB Manual

PROGRAM NO: - 11Unit/Topic: 1/8086 Programming

Problem Definition:

Write an assembly language program for printing n even numbers.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare the Data in DATA SEGMENT. Write Code in CODE SEGMENT. Declare a label NEXT. Add the value of AX with 2 Move the number in appropriate segment.

Input Set:

Output Set:

Notes:

Page 16: Micro Processor LAB Manual

PROGRAM NO: - 12Unit/Topic: 1/8086 Programming

Problem Definition:

Write an assembly language program for printing n odd numbers.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare the Data in DATA SEGMENT. Write Code in CODE SEGMENT. Declare a label NEXT. Add the value of AX with 2 Move the number in appropriate segment.

Input Set:

Output Set:

Notes:

Page 17: Micro Processor LAB Manual

PROGRAM NO: - 13Unit/Topic: 1/8086 Programming

Problem Definition:

Write an assembly language program to find largest between 2 numbers.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare the Data in DATA SEGMENT. Write Code in CODE SEGMENT. Declare a label GREATER, LESS, EQUAL. Compare the value of AX and BX. Move the number in appropriate segment.

Input Set:

Output Set:

Notes:

Page 18: Micro Processor LAB Manual

PROGRAM NO: - 14Unit/Topic: 1/8086 Programming

Problem Definition:

Write an assembly language program to calculate factorial of a given number.

Objective:

To understand the concept of Arithmetic Operation by processor 8086.

Algorithm:

Declare the Data in DATA SEGMENT. Write Code in CODE SEGMENT. Declare a label NEXT. Move the number in appropriate segment.

Input Set:

Output Set:

Notes: