Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Topic is MIPS Assembly Language. Write a program that takes 5 characters as parameters to a function named reverse5 . You are to write your

Topic is MIPS Assembly Language.

Write a program that takes 5 characters as parameters to a function named reverse5.

You are to write your program with a main label that has programming logic to call reverse5.

You should write reverse5 to take 5 parameters.

Use these characters in the part of the program with the main label:

H, A, P, P, Y

These 5 characters are the 5 characters to pass to reverse5. The are to be arranged so that:

H is the first character parameter, A is the second character parameter. P is the third character parameter, P is the forth character parameter. Y is the fifth character parameter.

Each parameter must be a single character. None of the parameters are allowed to be strings.

reverse5 should do the following:

  1. pushes H on the stack first
  2. pushes A on the stack second
  3. pushes P on the stack third
  4. pushes P on the stack forth
  5. pushes Y on the stack fifth (last)
  6. prints each character before it is popped off of the stack
  7. pops the characters off the stack in the reverse order that the characters are placed on the stack. This means the characters should be printed and the stack popped in this order:
    1. print Y then pop
    2. print P then pop
    3. print P then pop
    4. print A then pop
    5. print H then pop for the last time

This means when reverse5 has returned to where it was called, the printing should output the characters to display in this way: YPPAH

Write comments in your program that state your name, the programming logic, and any details you feel you'd like to explain that state about how you are using the assembly language instructions.

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions