Course Solutions Uncategorized (Solved) : Factorial Iterativeasm Include Cs47macroasm Data Msg1 Asciiz Enter Number Msg2 Asciiz Fac Q35570732 . . . .

(Solved) : Factorial Iterativeasm Include Cs47macroasm Data Msg1 Asciiz Enter Number Msg2 Asciiz Fac Q35570732 . . . .

 

Instructions: . Download Factorial Iterative.asm n in a directory. Copy your updated cs47_macro.asm from PA03 in the same dir

Factorial iterative.asm

.include “./cs47_macro.asm”

.data

msg1: .asciiz “Enter a number ? “

msg2: .asciiz “Factorial of the number is “

charCR: .asciiz “n”

.text

.globl main

main: print_str(msg1)

read_int($t0)

# Write body of the iterative

# factorial program here

# Store the factorial result into

# register $s0

#

# DON’T IMPLEMENT RECURSIVE ROUTINE

# WE NEED AN ITERATIVE IMPLEMENTATION

# RIGHT AT THIS POSITION.

# DONT USE ‘jal’ AS IN PROCEDURAL /

# RECURSIVE IMPLEMENTATION.

print_str(msg2)

print_reg_int($s0)

print_str(charCR)

exit

cs47_macro.asm

#<—————— MACRO DEFINITIONS———————->#
# Macro : print_str
# Usage: print_str(

)
.macro print_str($arg)
   li   $v0, 4 # System call code forprint_str
   la   $a0, $arg # Address of

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post