Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You've probably heard of factorial of a number. The factorial of the number 6 is 1x2x3x4x5x6 or 6x5x4x3x2x1. In this problem we are going to

image text in transcribed

You've probably heard of factorial of a number. The factorial of the number 6 is 1x2x3x4x5x6 or 6x5x4x3x2x1. In this problem we are going to change is method slightly to our need. In odd factorial, we would multiply just the odd numbers. For example, the odd factorial of 5 would be 1x3x5. Odd factorial of 6 would be 1x3x5 too. Write an assembly program to calculate the odd factorial of a given number stored in a Data Section variable [varl] and store the final value it into rax. Use double-word multiplication statement for this problem. Below is a template you can use to write your code ; template program EXIT_SUCCESS equ 0 SYS_exit equ 60 var1 dd 7; odd factorial to be calculated section .text global _start _start: mov rcx, dword [var1] ; _bye: mov rax, SYS_exit mov rdi, EXIT_SUCCESS syscall You've probably heard of factorial of a number. The factorial of the number 6 is 1x2x3x4x5x6 or 6x5x4x3x2x1. In this problem we are going to change is method slightly to our need. In odd factorial, we would multiply just the odd numbers. For example, the odd factorial of 5 would be 1x3x5. Odd factorial of 6 would be 1x3x5 too. Write an assembly program to calculate the odd factorial of a given number stored in a Data Section variable [varl] and store the final value it into rax. Use double-word multiplication statement for this problem. Below is a template you can use to write your code ; template program EXIT_SUCCESS equ 0 SYS_exit equ 60 var1 dd 7; odd factorial to be calculated section .text global _start _start: mov rcx, dword [var1] ; _bye: mov rax, SYS_exit mov rdi, EXIT_SUCCESS syscall

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions