Home » Embedded Systems

Find square of an 8-bit number | 8085 Microprocessor

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

Problem: To find the square of an 8-bit number using 8085 Microprocessor.

Algorithm:

  1. Load the register H with value 20H and the register L with value 50H and the value of accumulator with 00H.
  2. Load the content of register B with the value taken from memory.
  3. Add the content of M in accumulator A and decrement the value of register B by one.
  4. Check if value of register B is 00 if yes then store result at memory location otherwise goto step 3.
  5. Terminate the program.

Program:

	MVI     L 50
	MVI     H 20
	MVI     A 00
	MOV     B, M
	**ADD   M
	DCR     B
	JNZ **
	STA     3050
	HLT

Observation:

    INPUT:
    2050 : 03

    OUTPUT:
    3050 : 09

Hence, we successfully find the square 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.