You are on page 1of 12

Steps in Program Development

Program development is a multi-step process. The steps are 1) Understand the problem 2)
Develop a solution 3) Write the program and test it.
1. Understand the problem: When you are assigned to develop a program for solving a
problem, you are given the programming requirements. Study these requirements
carefully resolve all doubts and ensure that you have understood it fully as per the
user requirements.
2. Develop a solution: Once you have understood the problem, you have to develop the
solution in terms of some programming language. The tools that help in this are:
a) Algorithm / Pseudo code
b) Flowchart
c) Programming Language, like MASM, TASMetc.,


a) Algorithm
Definition: A method of representing the step-by-step logical procedure for solving a
problem in natural language (like English, etc.) is called as an Algorithm.
Algorithm can also be defined as an ordered sequence of well-defined and effective
operations that, when executed, will always produce a result and eventually terminate in a
finite amount of time.
On the whole an algorithm is a recipe for finding a right answer to a problem by breaking it
down into simple steps.
Properties an Algorithm should possess:
a. Generality: The algorithm must be complete in itself so that it can also be used to solve all
problems of a specific type for given input data.
b. Input / Output: Each algorithm can take zero, one or more input data and must produce one
or more output values.
c. Optimization: Unnecessary steps should be eliminated so as to make the algorithm to
terminate in finite number of steps.
d. Effectiveness: Each step must be effective in the sense that it should be primitive (easily
convertible into program statement) and can be performed exactly in a finite amount of time.
e. Definiteness: Each step of the algorithm should be precisely and unambiguouslystated.



Programming and Testing:
A computer program is the sequence of instructions written in a computer language according
to the algorithm and computer follows these in carrying out its computations.
The process of writing a program is called programming.
Steps involved in MASM Programming:
Problem Understanding
Problem Definition
Program writing
Error analysis
Validation & Verification
Documentation & Maintenance

LAB CODE
1. Student should report to the concerned as per the time table.
2. Students who turn up late to the labs will in no case be permitted to the
program schedule for the day.
3. After completion of the program, certification of the concerned staff in-charge
in the observation book is necessary.
4. Student should bring a note book of 100 pages and should enter the
readings/observations into the note book while performing the experiment.
5. The record of observations along with the detailed experimental Algorithm of
the experiment in the immediate last session should be submitted and certified
staff member in-charge
6. Not more than 3 students in a group are permitted to perform the experiment on
the set.
7. The group-wise division made in the beginning should be adhered to and no
mix up of students among different groups will be permitted.
8. The components required pertaining to the experiment should be collected from
stores in-charge after duly filling in the requisition form.
9. When the experiment is completed, should disconnect the setup made by them,
and should return all the components / instruments taken for the purpose.
10. Any damage of the equipment or burn out components will be viewed
seriously either by putting penalty or by dismissing the total group of students
from the lab for the semester / year.
11. Students should be present in the labs for total scheduled duration.
12. Students are required to prepare thoroughly to perform the experiment before
coming to laboratory.
13. Algorithm sheets/data sheets provided to students groups should be
maintained neatly and to be returned after the experiment.













III year B.Tech ECE-I-semester
MICROPROCESSORS AND MICROCONTROLLERS LAB
JNTU SYLLABUS
LIST OF EXPERIMENTS

1. Write and execute an Assembly Language Program (ALP) to 8086 Processor to sort
the given array of 32 bit numbers in ascending and descending order.
2. Write and execute an Assembly Language Program (ALP) to 8086 Processor to pick
the median from the given array of numbers.
3. Write and execute an Assembly Language Program (ALP) to 8086 Processor to find
the length of a given string which terminates with a special character.
4. Write and execute an Assembly Language Program (ALP) to 8086 Processor to
reverse the given string and verify whether it is a palindrome.
5. Write and execute an Assembly Language Program (ALP) to 8086 Processor to verify
the password.
6. Write and execute an Assembly Language Program (ALP) to 8086 Processor to insert
or delete a character/ number from the given string.
7. Write and execute an Assembly Language Program (ALP) to 8086 Processor to call a
delay subroutine and display the character on the LED display.
8. Interface a keyboard to 8086 microprocessor and display the key number pressed on
the 7-segment display which is also interfaced to 8086
9. Write an interrupt service routine to 8086 when ever there is an interrupt request on
interrupt pin, which displays hello on a LCD.
10. Interface an 8086 microprocessor trainer kit to PC and establish a communication
between them through RS 232.
11. Interface DMA controller to 8086 and transfer bulk data from memory to I/O device.
12. Interface a stepper motor to 8086 and operate it in clockwise and anti-clockwise by
choosing variable step-size.
13. Interface an 8 bit ADC to 8086 and generate digital output and store it in memory for
the given square/ramp/triangle wave form inputs.
14. Interface an ADC to 8086 and generate step, ramp, triangle and square waveforms
with different periods.











Experiment No: 1
Experimentas given in the JNTUH curriculum.

Week1:
Write and execute an Assembly Language Program (ALP) to 8086 Processor to Add,
Subtract and Multiply 16 bit unsigned numbers. Store the result in extra segment.
AIM: To Write and execute an Assembly Language Program to Add, Subtract and Multiply
16 bit unsigned numbers. Store the result in extra segment.
ALGORITHM:
1. Start the Data segment
2. Initialize the input values if necessary
3. Ends the Data segment
4. Start the code segment
5. Initialize START Directive
6. Initialize Data segment
7. Clear the Contents of AX, BX registers
8. Assign 8-bit input values to the registers using indirect addressing mode.
9. Assign the values present in locations to the registers AX, BX
10. Add two numbers Which are stored in registers
11. Terminate the program with Interrupt statement
12. Ends the Code segment


INPUT: AX=5678H, BX= 2222H
OUTPUT: AX=789AH







PROBLEM DEFINITIONS DIFFERENT FROM JNTU TOPICS FOR WEEK1

P1: Program to perform ADDITION OF TWO 8-BIT OPERANDS using indirect
addressing mode
ALGORI THM:
1. Start the Data segment
2. Initialize the input values if necessary
3. Ends the Data segment
4. Start the code segment
5. Initialize START Directive
6. Initialize Data segment
7. Clear the Contents of AX, BX registers
8. Assign 8-bit input values to the registers using indirect addressing mode.
9. Assign the values present in locations to the registers AL, BL
10. Add two numbers Which are stored in registers
11. Terminate the program with Interrupt statement
12. Ends the Code segment

Test Case 1: 55H, 25H
Result:AX= 007A

Test Case 2:A5H, 55H
Result: AX= 00FA

P2: Program to perform SUBTRACTION OF TWO 8-BIT OPERANDS
SUBTRACTION using indirect Addressing modes
ALGORI THM:
1. Start the Data segment
2. Initialize the input values if necessary
3. Ends the Data segment
4. Start the code segment
5. Initialize START Directive
6. Initialize Data segment
7. Clear the Contents of AX, BX registers
8. Assign 8-bit input values to the registers using indirect addressing mode.
9. Assign the values present in locations to the registers AL, BL
10. Subtract two numbers Which are stored in registers
11. Terminate the program with Interrupt statement
12. Ends the Code segment

Test Case 1: 45H, 22H
Result: 23H

Test Case 2:85H, 26H
Result: AX= 005F

P3: Program to perform MULTIPLICATION OF TWO 8-BIT OPERANDS using
Register Addressing mode
ALGORI THM:
1. Start the Data segment
2. Initialize the input values if necessary
3. Ends the Data segment
4. Start the code segment
5. Initialize START Directive
6. Initialize Data segment
7. Clear the Contents of AX, BX registers
8. Assign 8-bit input values to the registers using indirect addressing mode.
9. Assign the values present in locations to the registers AL, BL
10. Multiply two numbers Which are stored in registers
11. Terminate the program with Interrupt statement
12. Ends the Code segment


Test Case 1: 15H, 05H
Result:AX= 0069H

Test Case 2: 0AH, 02H
Result: AX= 0020H


P4: Program to perform ADDITION OF TWO 16-BIT OPERANDS using indexed
Addressing mode
Test Case 1: 1234H, 0123H
Result:AX= 1357H

Test Case 2: 567AH, 2345H
Result: AX= 79BFH

P5: Program to perform SUBTRACTION OF TWO 16-BIT OPERANDS using register
Addressing mode
Test Case 1: 1234H, 0123H
Result: AX= 1111H

Test Case 2: 567AH, 2345H
Result: AX= 3335H

P6: Program to perform MULTIPLICATION OF TWO 16-BIT OPERANDS using
indirect Addressing mode
Test Case 1: 1234H, 0123H
Result: AX= 0014 B11CH

Test Case 2: 1111H, 000AH
Result: AX= AAAAH


P7: Program to perform 8-BIT MULTI-BYTE ADDITION OF GIVEN ARRAY OF
NUMBERS

ALGORI THM:
1. Start the Data segment
2. Initialize the input values by using Assembler directives
3. Ends the Data segment
4. Start the code segment
5. Initialize START Directive
6. Initialize Data segment
7. Clear the Contents of AX, & DX registers
8. Initialize Base register BX for offset address.
9. Initialize count register with array size, which is initialized in Data segment.
10. Assign 8-bit input values to the registers using indirect addressing mode.
11. Start the loop, First move the content of SI register to AL register
12. Move the content of DI register to DL register
13. Add the contents Present in AL register & DL register.
14. Store the result in Offset address.
15. Increment SI,DI & BX
16. Decrement Count register
17. Repeat the loop till the count register value becomes zero.
18. Terminate the program with Interrupt statement.
19. Ends the code segment.

Test Case 1: 10H, 12H, 25H, 16H
20H, 55H, 20H, 11H
Result: 30H, 67H, 45H, 27H

Test Case 2: 0AH, 59H, 55H, 25H
52H, 32H, 55H, 80H

Result: 5CH, 5BH, AAH, A5H

P8: Program to perform 8-BIT MULTI-BYTE SUBTRACTION OF GIVEN ARRAY OF
NUMBERS

ALGORI THM:
1. Start the Data segment
2. Initialize the input values by using Assembler directives
3. Ends the Data segment
4. Start the code segment
5. Initialize START Directive
6. Initialize Data segment
7. Clear the Contents of AX, & DX registers
8. Initialize Base register BX for offset address.
9. Initialize count register with array size, which is initialized in Data segment.
10. Assign 8-bit input values to the registers using indirect addressing mode.
11. Start the loop, First move the content of SI register to AL register
12. Move the content of DI register to DL register
13. Subtract the contents Present in AL register & DL register.
14. Store the result in Offset address.
15. Increment SI,DI & BX
16. Decrement Count register
17. Repeat the loop till the count register value becomes zero.
18. Terminate the program with Interrupt statement.
19. Ends the code segment.

Test Case 1: 20H, 55H, 25H, 16H
10H, 12H, 20H, 11H
Result: 10H, 43H, 05H, 05H

Test Case 2: 0AH, 59H, 55H, 25H
02H, 32H, 55H, 80H

Result:08H, 27H, 00H, A5H

P9: Program to perform 8-BIT MULTI-BYTE MULTIPLICATION OF GIVEN ARRAY OF
NUMBERS

ALGORI THM:
1. Start the Data segment
2. Initialize the input values by using Assembler directives
3. Ends the Data segment
4. Start the code segment
5. Initialize START Directive
6. Initialize Data segment
7. Clear the Contents of AX, & DX registers
8. Initialize Base register BX for offset address.
9. Initialize count register with array size, which is initialized in Data segment.
10. Assign 8-bit input values to the registers using indirect addressing mode.
11. Start the loop, First move the content of SI register to AL register
12. Move the content of DI register to DL register
13. Multiply the contents Present in AL register & DL register.
14. Store the result in Offset address.
15. Increment SI,DI & BX
16. Decrement Count register
17. Repeat the loop till the count register value becomes zero.
18. Terminate the program with Interrupt statement.
19. Ends the code segment.

Test Case 1:05H, 08H, 12H, 11H
02H, 03H, 05H, 05H
Result: 0AH, 18H, 5AH, 55H

Test Case 2: 10H, 12H, 08H, 22H
0AH, 06H, 03H, 05H

Result:A0H, 6CH, 18H, AAH

P10: Program to perform 8-BIT MULTI-BYTE DIVISION OF GIVEN ARRAY OF
NUMBERS

ALGORI THM:
1. Start the Data segment
2. Initialize the input values by using Assembler directives
3. Ends the Data segment
4. Start the code segment
5. Initialize START Directive
6. Initialize Data segment
7. Clear the Contents of AX, & DX registers
8. Initialize Base register BX for offset address.
9. Initialize count register with array size, which is initialized in Data segment.
10. Assign 8-bit input values to the registers using indirect addressing mode.
11. Start the loop, First move the content of SI register to AL register
12. Move the content of DI register to DL register
13. Divide the contents Present in AL register by DL register.
14. Store the result in Offset address.
15. Increment SI,DI & BX
16. Decrement Count register
17. Repeat the loop till the count register value becomes zero.
18. Terminate the program with Interrupt statement.
19. Ends the code segment.

Test Case 1: 05H, 08H, 12H, 140004H
02H, 03H, 05H, 05H
Result: 0102H, 0202H, 0303H,

Test Case 2: 10H, 12H, 18H, 22H
02H, 06H, 03H, 05H

Result:0008H, 0003H, 0008H, 0406H

You might also like