Jan 17, 2016

8051 Assembly Program Code to find Square of a Number - AT89C51 - Keil


The program is compiled in Keil for 8051 - AT89C51 in assembly language.

Program to find square of a number,

Flowchart:-



Program:-

ORG 0000H
MOV R0,#50H
MOV A,@R0
MOV R2,A
MOV RI,#01H
CLR A
LOOP: ADDC A,R1
INC R1
INC R1
DJNZ R2,LOOP
INC R0
MOV @R0,A
HERE: SJMP HERE
END

Output:-



For more ASM programs - click here