# Square of a number using a look-up table (assembly language program)

Problem statement: Write down an assembly language program to find the square of the numbers stored as an array starting at memory location C100H. Store the result as an array starting at memory location C200H. Assume that there are five numbers in the array.

## Solution:

### how to solve

The following program uses the look-up table concept. Instead of finding the squares by arithmetic operations, the calculated values of squares of 0 to 9 are stored in memory locations.

These memory locations are accessed using their addresses, the last digits of which are from zero to nine.

The program given in the table uses three register pairs and the indirect addressing mode for data transfer.

### Look-up table for squares of numbers 0 to 9

The look-up table for squares of numbers 0 to 9 is given below:

### RESULT

Square of a number using a look-up table (assembly language program)
Scroll to top
error: physicsTeacher.in