8086 program to determine cubes of numbers in an array of n numbers
Problem – Write a program in 8086 microprocessor to find out the cubes of 8-bit n numbers, where size “n” is stored at offset 500 and the numbers are stored from offset 501 and store the result numbers into offset 501.(assuming cubes comes out to be in limit of 8 bit only).
Example –

Algorithm –
- Store 500 to SI and Load data from offset 500 to register CL and set register CH to 00 (for count).
- Increase the value of SI by 1.
- Load number(value) from offset SI to register AL.
- Move the value of register AL to BL.
- Multiply the value in register AL by itself.
- Multiply the value in register AL by BL.
- Store the result (value of register AL ) to memory offset SI.
- Increase the value of SI by 1.
- Loop above 6 till register CX gets 0.
Program –
| MEMORY ADDRESS | MNEMONICS | COMMENT |
|---|---|---|
| 400 | MOV SI, 500 | SI<-500 |
| 403 | MOV CL, [SI] | CL<-[SI] |
| 405 | MOV CH, 00 | CH<-00 |
| 407 | INC SI | SI<-SI+1 |
| 408 | MOV AL, [SI] | AL<-[SI] |
| 40A | MOV BL, AL | BL<-AL |
| 40C | MUL AL | AX=AL*AL |
| 40E | MUL BL | AX=AL*BL |
| 410 | MOV [SI], AL | AL->[SI] |
| 412 | INC SI | SI<-SI+1 |
| 413 | LOOP 408 | JUMP TO 408 IF CX!=0 and CX=CX-1 |
| 415 | HLT | end |
Explanation –
- MOV SI, 500: set the value of SI to 500
- MOV CL, [SI]: load data from offset SI to register CL
- MOV CH, 00: set value of register CH to 00
- INC SI: increase value of SI by 1.
- MOV AL, [SI]: load value from offset SI to register AL
- MOV BL, AL: move value of register AL to BL.
- MUL AL: multiply value of register AL by AL.
- MUL BL: multiply value of register AL by BL.
- MOV [SI], AL: store value of register AL at offset SI.
- INC SI: increase value of SI by 1.
- LOOP 408: jump to address 408 if CX not 0 and CX=CX-1.
- HLT: stop
Recommended Posts:
- 8086 program to determine squares of numbers in an array of n numbers
- 8086 program to determine largest number in an array of n numbers
- 8086 program to determine product of corresponding elements of two array elements
- 8086 program to determine modulus of first array elements corresponding to another array elements
- 8086 program to add two 8 bit BCD numbers
- 8086 program to subtract two 8 bit BCD numbers
- 8086 program to add two 16 bit BCD numbers with carry
- 8086 program to multiply two 8 bit numbers
- 8086 program to multiply two 16-bit numbers
- 8086 program to subtract two 16 bit BCD numbers
- 8086 program to add two 16-bit numbers with or without carry
- 8086 program to subtract two 16-bit numbers with or without borrow
- 8086 program to generate AP series of n numbers
- 8086 program to generate G.P. series of n numbers
- 8086 program to find average of n numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

