
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
PayPal Gateway not configured
PayPal Gateway not configured