Question:
We have an array of whole numbers in the main program as follows:
ARRAY : 0,1,2,3,4,5,6,7,8,9,10
You are required to write an assembly language program having a subroutine “SUM_OF_SQUARE”. The subroutine should find out the square of each number and then add them together along with storing the result into a separate data label “SUM” as follows:
Copy “SUM” into “DX” after executing the subroutine.
Provide the final snapshot of AFD that should display the contents of data label “SUM” and “DX”.
Marking Distribution: (Total = 20 marks)
- AFD command used for showing data in data label “SUM”. (2 marks)
- AFD snapshot showing result of “SUM” and “DX”. (3 marks)
No comments:
Post a Comment