- Related Questions & Answers
- 8085 program to find sum of digits of 8 bit number
- 8085 program to reverse 8 bit number
- 8085 Program to Divide a 16-bit number by an 8-bit number
- 8085 program to find larger of two 8 bit numbers
- 8085 program to find maximum of two 8 bit numbers
- 8085 program to find minimum value of digit in the 8 bit number
- 8085 program to find square root of a number
- 8085 program to convert an 8 bit number into Grey number
- 8085 program to count number of once in the given 8-bit number
- 8085 program to perform AND operation in nibbles of 8 bit number
- 8086 program to find sum of digits of 8 bit number
- 8085 program to convert 8 bit BCD number into ASCII Code
- 8085 program to find 1's and 2's complement of 8-bit number
- 8085 Program to Add two 8 Bit numbers
- 8085 Program to Subtract two 8 Bit numbers

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

In this program, we will see how to find the square of an 8-bit number.

Write 8085 Assembly language program to find the square of a number The number is stored at location 8000H, store the result at 8050H.

In 8085, we cannot perform the multiplication operation directly. We are performing the multiplication by using repetitive addition. To get square of a number, we have to multiply the number with itself.

Address | Data |
---|---|

… | … |

8000 | 0C |

… | … |

Address | HEX Codes | Labels | Mnemonics | Comments |
---|---|---|---|---|

F000 | 21, 00, 80 | | LXI H,8000H | Load the number from 8000H |

F003 | AF | | XRA A | Clear accumulator |

F004 | 46 | | MOV B,M | Load data from memory to B |

F005 | 86 | LOOP | ADD M | Add memory byte with A |

F006 | 05 | | DCR B | Decrease B by 1 |

F007 | C2, 05, F0 | | JNZ LOOP | If Z = 0, jump to loop |

F00A | 32, 50, 80 | | STA 8050H | Store result into memory |

F00D | 76 | | HLT | Terminate the program |

Address | Data |
---|---|

… | … |

8050 | 90 |

… | … |

Advertisements