Question

Neeed to write a marie Assembly lanquage program that Inputs a number and subtracts by one....

Neeed to write a marie Assembly lanquage program that Inputs a number and subtracts by one. It also It shows the output of every subtraction until 0. So it shows a countdown of the input untill Zero

so something like

5

4

3

2

1

0

some lines used will look like this:

Input

Subt one

one, DEC 1

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Any qureies comment below

While,   Load   X   /Load address of X
   Store    X    /Store X  
   Output
   Subt   Ten   /Subtract ten
   Output
   Skipcond 000    /If value in AC is negative Skip next  
   Jump   End   /Otherwise, go to End
   Load    X   /Load initial value X
   Add   One   /Add one
   Store   X   /Store new X value
   Jump   While   /Jump to While loop
End,   Halt       /Terminate program      
X,   Dec   1  
Ten,   Dec   10
One,   Dec   1

Add a comment
Know the answer?
Add Answer to:
Neeed to write a marie Assembly lanquage program that Inputs a number and subtracts by one....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write MARIE assembly language programs that do the following: I. Write a program that inputs thre...

    Write MARIE assembly language programs that do the following: I. Write a program that inputs three integers, a, b, and c, in that order. It computes the following ia-bi-fc+ c The result should be written to output 2. Write a program that inputs integers, s. y, and z. It outputs the difference of the langest and first element entered. You may assume x. y, and z all have different values. So if 8, 12, and 9 are input, the output...

  • Marie Assembly Language

    Assembly (MARIE), how can I output my input variables on exit?I am trying to compose an assembly (MARIE) program to output my input variables **on exit**. I am triggering an exit when . (period) is entered. I am transforming the input, and to later display the new value on exit.Some context, FOO will return SBB when ran through Rot-13However, my program is displaying the output on each iteration of my loop. I am instead wanting to not display anything, until . is entered...

  • Write a MARIE assembly program that accepts one integer input. Use the the number to calculate...

    Write a MARIE assembly program that accepts one integer input. Use the the number to calculate the factorial. You must use addition not multiplication. Example: 5! = 5x4x3x2x1 Print out the result.

  • Finish the MARIE assembly language code below to determine the largest integer, the smallest integer, and...

    Finish the MARIE assembly language code below to determine the largest integer, the smallest integer, and the sum of integers for a sequence of 5 signed integers. The program already calculates the largest integer, just need it to calculate the smallest integer and the sum of the integers. The 5 integers should first be entered by the user via the input device. Your program is then assembled and run to determine the largest integer, the smallest integer, and the sum...

  • Using the MARIE computer assembly language, write a program that computes the following expression: z =...

    Using the MARIE computer assembly language, write a program that computes the following expression: z = a * b * c. The computer will read in the input values a, b, and c from the keyboard and the final result (z) have to be displayed. In addition, every time an input value is read in, it must be displayed on the screen. Remember that the instruction set does not have an instruction to execute multiplication. The program must be tested...

  • This is a Java program Write a program that reads an unspecified number of integers, determines...

    This is a Java program Write a program that reads an unspecified number of integers, determines home many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number to 2 decimal places. System.out.println(countPositive); System.out.println(countNegative); System.out.println(total); System.out.printf("%.2f",total * 1.0 / count); Assume inputs are always integer [-912985158, 912985158] and ends with 0. Input 1 2 -1 3...

  • C++ Write a program that asks for a number and then prints as many lines as...

    C++ Write a program that asks for a number and then prints as many lines as the user inputs. Each line contains as many pairs of characters ("*#") as the number of this line. It should look like the right half of a pyramid. Your version of the program must print the same result as the expected output. To to this lab, you must use two do-while loops. Two exceptions: When the user inputs a number less than 1, then...

  • Problem 6(15 Points) MARIE Assembly Programming Develop a MARIE program containing a main function which finds the smallest element of an array T is shown below. The passing arguments and one sub...

    Problem 6(15 Points) MARIE Assembly Programming Develop a MARIE program containing a main function which finds the smallest element of an array T is shown below. The passing arguments and one subroutine function called Sindmin findmin function array and the aro the findmin subroutine functon are the beginning e pseudo code for the subroutine elements of Array1 and Arra array size Continue the following MARIE program to find the smallest ORG 100 Jump Start nt findmin (int "addr, int size)...

  • M.A.R.I.E assembly code for 7th value of Fibonacci sequence: Fib(1) = 1, Fib(2) = 1, Fib(n)...

    M.A.R.I.E assembly code for 7th value of Fibonacci sequence: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n-1) + Fib(n-2). The program calculates Fib(7). I have 4 errors in my code and cannot seem to find the solutions here is the code so far, ORG 100    Input    Store x    Input    Store y FOR_INIT, LOAD one STORE i FOR_COND, LOAD i SUBT seven SKIPCOND 800 JUMP FOR_BODY JUMP END_FOR FOR_BODY, LOAD x ADD y STORE z LOAD...

  • Write a MARIE program to implement one round of rock paper scissors game. Your program should...

    Write a MARIE program to implement one round of rock paper scissors game. Your program should represent the three moves ‘rock’, ‘paper’ and ‘scissors’ with numbers 1, 2 and 3 respectively. When the program is run, there should be two input prompts, one after the other, to ask for player 1’s and player 2’s moves (a number 1, 2 or 3). Then the program would compare both numbers and apply the following rules to work out the winner. Paper beats...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT