1. The following function procedure returns the sum of the Pth powers of the elements in a vector V of N elements. The input parameters and the result are to be passed in registers as follows: SI: pointer to vector v CX: value n BX: value p AX: result procedure SumPwrs( var v: vector; n, p: integer): integer; var i, j, s, (* assign reg DI *) t: integer; (* assign reg AX *) begin if p = 0 then s := n else s := 0; for i := 0 to n-1 do t := 1; for j := 1 to p do t := t * v[ i] endfor; s := s + t endfor endif; return s end; Use the following procedure to test SumPwrs. procedure assign08; var s, n, p: integer; v: array[ 0 .. 99] of integer begin write ‘N? ‘; read n; write cr, lf, ‘P? ‘; read p; write cr, lf, ‘V? ‘, cr, lf getvec( v, n); s := sumpwrs( v, n, p); write cr, lf, s end; Each procedure should be in a separately assembled module. The code for GetVec is available in the Examples directory. Pascal and C implementations of the above procedures, called snp.p and snp.c respectively, are also in Examples.
ScholarMatic | 24/7 Homework Help
ScholarMatic Will Help You Write Your Essays and Term Papers
Answered » You can buy a ready-made answer or pick a professional tutor to order an original one.
assembly language programming
i need it to be done in .asm file
Document Preview:
HOME TO CERTIFIED WRITERS

Why Place An Order With Us?
- Certified Editors
- 24/7 Customer Support
- Profesional Research
- Easy to Use System Interface
- Student Friendly Pricing
Have a similar question?
ScholarMatic: Get Started
Assignment Writing Service
Feel safe and secure when placing an order on our portal!
Fruitful cooperation begins with solid guarantees, and we are professional enough to promise perfect results. Let’s get it started!




