Question: Assembly help asm # 2 and #3 would be helpful please in assembly language Given a signed array of bytes, X, of unknown length. If

Assembly help

asm

# 2 and #3 would be helpful please in assembly language

  1. Given a signed array of bytes, X, of unknown length. If Z is an array representing the continuing product of the array values, define Z and compute its value. E.g. if X = {-1,-2,-3,-4,-5,-6} then Z = {-1,2,-6,24,-120,720}.

  2. A prime number is a number divisible by itself and 1 only. Given a doubleword unsigned value in X. Write a program that will set the byte variable Prime = 1 if X is prime, and 0 otherwise.
  3. Given an unsigned byte X. If X is even divide it by 2. If it odd multiply it by 3 then add 1. Collatz theorizes that all numbers must converge to 1 (no one has proved it yet, but they tested all numbers up beyond 10^10 and they all work). Write a program that will count how many steps before the number reaches 1 (1 step is when divide by 2 or when you multiply by 3 then add 1).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!