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

by | Nov 29, 2023 | questions

i need it to be done in .asm file

Document Preview:

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.

Attachments:


ScholarMatic: Explanation & Answer

Your ready answer from a verified tutor is just a click away for as little as $14.99


  

Click Order Now to get 100% Original Answer Customized to your instructions!

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?

PLAGIRAISM FREE PAPERS

All papers we provide are well-researched, properly formatted and cited.

TOP QUALITY

All papers we provide are well-researched, properly formatted and cited.

HIGHLY SECURED

All papers we provide are well-researched, properly formatted and cited.

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!