Professional Documents
Culture Documents
Date: 20.05.2021
Student Details:
Roll Number 44
Semester II
Section J
Group J-43,J-44
PRACTICAL NO. - 1
Aim:
AIM:
A) To write and execute an assembly language program to add the given two 8 bit numbers.
Apparatus:
1.8051 microcontroller kit
2.Keiluvision 5 development tool
Theory:
Algorithm:
1) Addition without carry
1. Start the Program.
2. Move the Data1 to the accumulator.
3. Add the Data2 with the accumulator, the result stored in accumulator.
4. Move the result which is in accumulator to the 30H address location.
5. Stop the Program.
Aim:
Aim:
B) To write and execute an assembly language program to subtract the given two 8 Bit Numbers.
Algorithm:
1. Start the program
2. Move the data 1 to the accumulator
3. Subtract the data2 with the accumulator, the result stored in accumulator.
4. Move the result which is stored in the accumulator to the register 30H memory location.
5. Stop
Algorithm:
6. Move the multiplicand to accumulator.
7. Move the multiplier to ‘B’ register (SFR with direct address FOH)
8. Multiply the contents of Accumulator and ‘B’ register.
9. Store the lower byte result from ‘A’ register to 8300 memory location 5. Store the higher byte result from ‘B’
register to 8301 memory location
6. Stop or Halt the program execution.
Algorithm:
1. Move the dividend to accumulator.
2. Move the divisor to ‘B’ register.
3. Divide the contents of Accumulator and ‘B’ register.
4. Store the result in register r3 and move content of b in register r4.
5. Stop or Halt the program execution.
1. Start
2. Move the content to the accumulator.
3. Increment the content of accumulator.
4. Move the incremented value at the accumulator to register r5.
5. Stop.
5. Stop.
Result:
Thus an assembly language program 8 bit addition, subtraction multiplication, division, increment and decrement
were written and executed successfully.
Postlab:
1. Explain the difference between the following two instructions: MOVX A,@DPTR MOVC
A,@A+DPTR
2. Circle the invalid instructions. MOV R2,@R1 MOV A,@R2 MOVC A,@A+DPTR MOV R1,R2