google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.: Algorithm of microprocessors programming

Tuesday, January 7, 2014

Algorithm of microprocessors programming

Microprocessor Programming 8085 and 8086:-
Experiment No. 1 - Addition of Two 8-bit Numbers and Sum is 8-bit
Algorithm:-
1.Initialize the memory location of first number in HL register pair.
2.Move first number/data into accumulator
3.Increment the content of HL register pair to initialize the memory location of second data
4.Add the second data with accumulator
5.Store the result in memory location 8003H


Experiment No. 2 - Addition of two 8 bit numbers and sum is 16-bit
Algorithm:-
1.Initialize the memory location of 1st data in HL register pair.
2.Store first data in the memory location.
3.Increment the content of HL register pair for entering next data in the next memory location.
4.Store second data in the memory location.
5.Move second number in accumulator.
6.Decrease the content of HL register pair.
7.Add the content of memory (first data) with accumulator.
8.Store the results in memory location 8503H and 8504H.


Experiment No. 3 - Addition of Two 16-Bit Numbers and Sum is 16-bit
Algorithm:-
1.Store first 16-bit number in H-L pair.
2.Exchange the contents of D-E pair and H-L pair to store first number in D-E registers pair.
3.Store second 16-bit number in HL register pair.
4.Addition of 1st and 2nd number
5.Store result in 8505H and 8506H locations.


Experiment No. 4 - Decimal Addition of Two 8-Bit Numbers and Sum is 8-bit
Algorithm:-
1.Initialize the memory location of first number in HL register pair.
2.Load the first number in accumulator
3.Increment the content of HL register pair to initialize the memory location of second data
4.Addition of the content of second memory location with first data
5.Decimal adjustment of result
6.Store the result in memory location 8002H


Experiment No. 5 - One’s Complement of an 8-bit Number
Algorithm:-
1.Load memory location of data 8050H in H-L registers pair.
2.Move data into accumulator
3.Complement accumulator
4.Store the result in memory location 8051H


Experiment No. 6- Two’s Complement of an 8-bit Number
Algorithm:-
1.Transfer the content of memory location 8500H to accumulator.
2.Complement the content of accumulator
3.Add 01H with accumulator to get two’s complement of number
4.Store the result in memory location 8501H


Experiment No. 7 - Program to Multiply Two 8 Bit Numbers
Algorithm:-
1.Load first number in AL register.
2.Store the second data in BL register
3.Multiply contents of AL by BL


Experiment No. 8 - Program to Divide Two 8 Bit Numbers.
Algorithm:-
1. Load first number in AL register.
2.Store the second data in CL register
3.Divide contents of AL by CL and result is AX


2 comments:

  1. if you want to print a message then use lea with DX register and the message msg

    ReplyDelete
    Replies
    1. Yes you can use lea TO PRINT;
      Example:
      DATA SEGMENT
      MESSAGE DB "HELLO WORLD!!!$"
      ENDS

      CODE SEGEMENT
      ASSUME DS:DATA CS:CODE
      START :
      MOV AX,DATA
      MOV DS,AX
      LEA DX,MESSAGE
      MOV AH,9
      INT 21H
      MOV AH,4CH
      INT 21H
      ENDS
      END START
      __________________________
      output:
      HELLO WORLD!!!

      Delete

रामायण

रामायण दशरथ की तीन पत्नियाँ – कौशल्या, सुमित्रा , कैकेयी दशरथ के चार पुत्र – राम,लक्ष्मण,भरत,शत्रुघ्न दशरथ: राम के पिता और कौशल के राजा कौशल...