209k views
3 votes
ALP to find cube of N 8-bit numbers in an array using 8086

User Drunken M
by
4.0k points

1 Answer

3 votes

Answer:

200 MOV Si, 500

201 MOV CL [Si]

202 MOV CH,00

203 INC SI

204 MOV AL,[SI]

205 A MOV BL, AL

205 C MUL AL

205 E MUL BL

206 MOV [SI], AL

207 INC SI

208 LOOP 104

209 HLT

The above ALP program is the required one.

Step-by-step explanation:

Step1: SI value = 500

Step 2:SI offset data is loaded to the CL register

Step 3: SI value = SI value + 1

Step 4: The register value is moved from AL to BL

AL happens to be an 8-bit register

Step 5: The AL value is multiplied by itself

Step 6: The value of the AL is now multiplied by BL

Step 7: The new value of the AL is stored at the SI.

Step 8: The value of the SI is incremented by 1..

LOOP 104: The program is now transferred to the 104 in case the CX=CX -1 and CX is not 0.

HLT: stop

User Yaroslav Rogoza
by
4.3k points