View the step-by-step solution to:

Question

 "Create a " program called

lab3.3.asm as follows:

 • "create a" simple calculator to calculate Decimal to Binary 

 • the program will implement the piece of C code described on the right. Be careful, we don't allow to use any other algorithm to calculate Decimal to Binary. You should follow the algorithm list on the right

 • You can use registers to represent number, counter, mask;



The code is given in the problem.

  int number, counter, mask;

  

  printf("Enter an integer in decimal number systemn");

  scanf("%d", &number);

  printf("%d in binary number system is:n", number);

  mask = 1;

  for (counter = 31; counter >= 0; counter --)

  {

  int temp = number >> counter;

 

   if ((temp & mask) == 1)

    printf("1");

   else

    printf("0");

  }

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes