Question

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.

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

Code is as follows-

DATA SEGMENT A DB 5 DATA ENDS CODE SEGMENT ASSUME DS:DATA,CS:CODE START: MOV AX,DATA MOV DS,AX MOV AH,00 MOV AL,A L1: DEC A MUL A MOV CL,A CMP CL,01 JNZ L1 MOV AH,4CH INT 21H CODE ENDS END START ;OUTPUT:-> ;-G CS: 001B ; ;AX=0078 BX=0000 CX=0001 DX=0000 SP=0000 BP=0000 SI=0000 DI=0000 ;DS=0BA8 ES=0B98 SS=0BA8 CS=0BA9 IP=001B NV UP EI PL ZR NA PE NC ;0BA9:001B B44C MOV AH,4C 
Add a comment
Know the answer?
Add Answer to:
Write a MARIE assembly program that accepts one integer input. Use the the number to calculate...
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
  • 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...

  • Write a C program that accepts a single integer N. Your code must then calculate the...

    Write a C program that accepts a single integer N. Your code must then calculate the average of all positive integers less than N that are divisible by either 5 or 7, but not both. When you print your average, truncate the result to three decimal places. Do not print anything else to the screen. Example input: 19 Example output: 10.200

  • 2. Write a Marie program that accepts two positive (inputs) two integers and outputs the sum...

    2. Write a Marie program that accepts two positive (inputs) two integers and outputs the sum of both of the integers and all the numbers in between Write a Marie program that determines the largest of a series of positive integers provided by a user. The user will enter a -1 when she is finished. Up to 10 numbers will be provided by the user. Write a Marie program that accepts two positive integers, multiples them by repeated addition, and...

  • 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...

  • 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

  • Write a program in Python that accepts as input an integer N and a real number...

    Write a program in Python that accepts as input an integer N and a real number c, and outputs the coefficient of the Nth degree term of the Taylor series for the function f(x) = ex centered at c. This process should recur until the user enters a quit code. Erroneous input should be excepted as necessary, and should result in a new prompt.

  • 1. Write a program that takes a number as input and check whether the number is...

    1. Write a program that takes a number as input and check whether the number is positive, negative or zero. 2. Write a C++ program that prompts the user to enter a number and checks whether the entered number is even or odd. 3.  Using switch-case statement write a C++ program that prompts the user to enter 1, 2 or 3 and display "Red" if selection is 1, "Yellow" if selection is 2, or "Green" if selection is 3. 4. Write...

  • Convert the following C fragment to equivalent MIPS assembly language Write mini calculator that take two...

    Convert the following C fragment to equivalent MIPS assembly language Write mini calculator that take two integer numbers as input and ask the user if he need to compute addition, subtraction, remainder, division, or multiplication then print the result. Hint: you can give each operation a special number. For example, the addition (1), subtraction (2), …. And so on. The output must be something like: Enter the first integer number: 5 Enter the second integer number: 3 Which operation? 1...

  • 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...

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