Ask Question

Translate the following C program to Pep/9 assembly language. It multiplies two integers using a recursive shift-and-add algorithm. mpr stands for multiplier and mcand stands for multiplicand. A recursive integer multiplication algorithm#include int times (int mpr, int mcand) { if (mpr = = 0) { return 0; } else if (mpr % 2 = = 1) { return times (mpr / 2, mcand * 2) + mcand; } else { return times (mpr / 2, mcand * 2); }}int main () { int n, m; scanf ("%d %d", &n, &m); printf ("Product: %d/n", times (n, m)); return 0; }

+1
Answers (1)
  1. 3 July, 14:59
    0
    Data BP
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Translate the following C program to Pep/9 assembly language. It multiplies two integers using a recursive shift-and-add algorithm. mpr ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers