Q1. Calculating the Sum of an Array Row Write a procedure named “calc_row_sum” that calculates the sum of a single row i
Posted: Wed Apr 27, 2022 3:47 pm
Q1. Calculating the Sum of an Array Row
Write a procedure named “calc_row_sum” that calculates the sum of a single row in a two-dimensional array of bytes or words. The procedure should have the following stack parameters: array offset, row size, array type, row index. It must return the sum in AX. Use explicit stack parameters. Write a program that tests your procedure with arrays of byte or word. Prompt the user for the row index, and display the sum of the selected row.
Note: Stack parameter means passing parameters through stack. Make sure you take inputs from the user.
Write a procedure named “calc_row_sum” that calculates the sum of a single row in a two-dimensional array of bytes or words. The procedure should have the following stack parameters: array offset, row size, array type, row index. It must return the sum in AX. Use explicit stack parameters. Write a program that tests your procedure with arrays of byte or word. Prompt the user for the row index, and display the sum of the selected row.
Note: Stack parameter means passing parameters through stack. Make sure you take inputs from the user.