Home » Embedded Systems

Find square root of an 8-bit number |8085 Microprocessor

Here, we are going to learn how to find square root of an 8-bit number using 8086 Microprocessor?
Submitted by Akash Kumar, on November 10, 2018

Problem: To find square root of a number using 8085 Microprocessor.

Algorithm:

  1. Assign the value of register D and E with 01H.
  2. Load the number from memory.
  3. Subtract the content of accumulator with the content of register D.
  4. Check if the value of accumulator is zero if yes goto step 8.
  5. Increase the content of register by 02H.
  6. Increase the content of register by 01H.
  7. Goto step 3.
  8. Move the content of register E to accumulator.
  9. Store the result of register E to the memory.
  10. Terminate the program.

Program:

    MVI     E, 01
    MVI     D, 01
    LDA     2050
    **** SUB D
    JZ  ***
    ADI     D, 02
    INC     E
    JMP ****
    *** MOV A, E
    STA     3050
    HLT

Observation:

    INPUT:
    2050 : 09

    OUTPUT:
    2051 : 03

Hence, we successfully find the square root of an 8-bit number using 8085 Microprocessor.






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL







Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.