Monday, October 26, 2015

8085 Program to Find the Smallest Data

Let us suppose that we have 10 data’s which are stored from memory address 9000H to 9009H. We find the smallest number from these data’s and store the value in 9100H.

Algorithm:

  1. Start.
  2. Load into register pair HL from memory location 9000H.
  3. Move 09 into register C.
  4. Move the contents of memory M into accumulator A.
  5. Increment register pair HL by 1.

8085 Program to Find the Greatest Data

Let us suppose that we have 10 data’s which are stored from memory address 9000H to 9009H. We find the largest number from these data’s and store the value in 9100H.

Algorithm:

  1.   Start.
  2. Load into register pair HL from memory location 9000H.
  3. Move 09 into register C.
  4. Move the contents of memory M into accumulator A.
  5. Increment register pair HL by 1.

8085 Program to Find the Square of a Number

Let us suppose that the number whose square root is to be found is stored in memory location 9000H and the result is to be stored in memory location 9100H.

Algorithm:

  1. Start.
  2. Load into register pair HL from memory address 9000H.
  3. Initialize accumulator A with 00.
  4. Move contents of memory M into register C.

Sunday, October 25, 2015

8085 Program to Add 10 Data Starting From Specific Memory Address

Let us suppose that 10 data’s are stored in memory location from 9000H to 9009H. These data’s are to be added and let us store the result in memory location 9100H.

Algorithm:

  1. Start.
  2. Load into register pair HL from memory location 9000H.
  3. Load into register pair DE from memory location 9100H.
  4. Move 09 into register C as counter.

8085 Program to Copy 16 Data from One Location to another Location

Let us suppose that the 16 data are stored starting from 9000H and we are to move the data into location starting from 9100H.

Algorithm:

  1. Start.
  2. Load into register pair HL from memory location 9000H which is the source location.
  3. Load into register pair DE from 9100H which is the destination location.
  4. Move 10 into register C which acts as counter (16 in decimal = 10 in hexadecimal).

8085 Program To Divide Two 8 Bit Numbers

Let us suppose that we store the two 8 bit numbers that are to be divided in the memory location 9000H and 9001H. Now the remainder of these numbers is to be stored in 9002H and the quotient is to be stored in 9003H.

Algorithm:

  1. Start
  2. Initialize register C with 00.
  3. Load into accumulator directly from location 9000H.
  4. Move content of A into register B.
  5. Load into accumulator directly from 9001H.
  6. Compare register B with accumulator A.

Wednesday, October 21, 2015

8085 Program To Multiply Two 8 Bit Numbers

Let us suppose that we store the two 8 bit numbers that are to be multiplied in the memory location 9000H and 9001H. Now the product of these numbers is to be stored in 9002H and the carry is to be stored in 9003H.

Algorithm:

  1. Start
  2. Initialize register C with 00.
  3. Load into accumulator directly from location 9000H.
  4. Move content of A into register B.
  5. Load into accumulator directly from 9001H.