Computer Science, asked by tarunvadhaman02, 1 month ago

write an assembly language program to find odd number from block of data stored from d050h to d059h and store total count at the end of the list.​

Answers

Answered by SumitJagannath
1

Answer:

Concept: Instruction Set and Programming of 8085

Answered by dayanidhisharma19
0

Answer:

program algorithm

  1. Load the memory location d050H in HL register pair.
  2. Load the memory location d054H in DE register pair for storing odd numbers.
  3. Store the number of elements in register C.
  4. Move the next number in the list to accumulator.
  5. Perform AND operation with 01H to check whether the number is even or odd.
  6. If even, jump to step 9.
  7. Get the number in accumulator and store in the memory location pointed by DE.
  8. Increment DE.
  9. Increment HL. Decrement C.
  10. If C is not zero, jump to step 4.

Explanation:

In this program instruction set and programming of 8085 is used.

For example we can Store odd numbers in another list starting from memory location d050H. Store even numbers in another list starting from memory location d059H. Starting address of the list is d050H.

A number is said to be odd if its least significant bit is 1 otherwise it is even. Therefore to identify whether the number is even or odd, we perform AND operation with 01 by the help of ANI instruction. If the number is odd then we will get 01 otherwise 00 in the accumulator.

Similar questions