MIPS Assembly Challenge: Arrays Patterns Ciphers and Syscall Driven Assessment

Download Solution Order New Solution

Questions 

1. Write a MIPS program that calculates the sum of all positive numbers of an 1-D array. Your .data section should have an example. You are allowed to define the array length in the .data section.

2. Write a MIPS program that prints the position of the bigger element of an 1D array. Your .data section should have an example. You are allowed to define the array length in the .data section.

3. Write a program in assembly that will print Floyd's triangle. The number of rows should be defined in the .data section.

Alice accused Bob that he's not good at practical jokes. Bob was devastated, despite the fact that she was clearly joking. Later, Alice said sorry in their bilateral chat, and asked how he's feeling about her -- is it goodbye or just a silly fight? After a few minutes, she gets a message from Bob, but it's just some (43 to be exact) numbers in a row...

101 121 121 125 126 55 34 34 122 122 122 35 116 98 120 121 120 111 104 35 110 98 96 34 122 108 121 110 101 50 123 48 105 92 122 57 122 52 90 106 85 110 92

She thinks twice and suspects that Bob's main obsessions, MIPS and the number 13, can play a role in decrypting the message. But she doesn't know MIPS...

Write a MIPS program that will make her understand how Bob is feeling. Does Bob still love her? Don't let her down!!

4. After their fight, Alice and Bob are now speaking again. To show his feelings, Bob wrote a poem and gave it to Alice, saying that this poem and some magical numbers will be the key to a beautiful melody. However, Bob does not know any musical instrument. He only knows assembly, and he also thinks he's good at speaking Early Modern English (although others do not agree, but that's irrelevant), as seen in the poem:

If music thou wouldst grant to thee,
Then thrice on eleven must thy syscall be.
Fourteen notes in all, as thou shalt find 
Their pitch and time in lists assigned

These shalt thou play, then once again,
Repeat, repeat, full ten times ten.
Let trumpet sound, its number be
The noble voice of fifty-eight, ye see.

Now mark thou well the strength of sound,
But heed nop buffer sizes unbound 
A thousand still may fall to naught,
Yet one hundred twenty-seven should be sought.

When all’s complete and still thou art unbent,
Use syscall ten—and thus our tale is spent

72, 74, 74, 76, 79, 77, 76, 74, 72, 74, 67, 67, 69, 72

779, 1306, 779, 779, 122, 122, 122, 122, 779, 1306, 1701, 122, 122, 122

Alice is not sure what to do, and asks for your help. Write a program that will help her understand.

Assessment Summary

The assessment is designed to evaluate students’ understanding and practical skills in MIPS assembly programming through multiple tasks involving array manipulation, control flow, and problem-solving in creative, real-world-inspired scenarios. Key tasks include:

  1. Array Sum Calculation – Write a MIPS program to calculate the sum of all positive numbers in a 1D array.
  2. Largest Element Position – Write a MIPS program to identify and print the position of the largest element in a 1D array.
  3. Floyd’s Triangle – Write a MIPS program to generate and display Floyd’s triangle with a defined number of rows.
  4. Decrypting Bob’s Message – Write a MIPS program to decode a sequence of numbers representing Bob’s emotions.
  5. Musical Assembly Program – Write a MIPS program to interpret a sequence of numbers as musical notes based on Early Modern English instructions in a poem.

The assessment emphasizes:

  • Correct usage of MIPS registers, loops, and syscall operations.
  • Working with arrays and control structures.
  • Problem-solving using assembly in both practical and creative scenarios.
  • Translating a logical problem into an executable program.

Step-by-Step Mentor Guidance

Step 1: Understanding the Problem

  • The mentor begins by helping the student analyze each task separately.
  • For array-based problems, the mentor ensures the student understands array indexing, initialization in the .data section, and iteration through loops.
  • For the creative/decryption tasks, the mentor emphasizes breaking the problem into smaller logical units (e.g., mapping numbers to letters or musical notes).

Step 2: Planning the Program Structure

  • The mentor guides the student to design the program flow before coding:
    • Define arrays and data in the .data section.
    • Use registers for counters, accumulators, and temporary storage.
    • Outline loops for iteration and conditional checks.
    • Plan syscalls for output.

Step 3: Coding Each Task

  • Task 1 & 2 (Array Sum & Max Element):

    • Mentor demonstrates loop iteration over arrays.
    • Shows how to compare values and update accumulator or max variables.
    • Guides in printing results using syscalls.
  • Task 3 (Floyd’s Triangle):

    • Mentor explains nested loops for row and column logic.
    • Shows how to incrementally print numbers and newlines using syscalls.

  • Task 4 (Decrypting Bob’s Message):

    • Mentor guides student to map numeric codes to ASCII characters.
    • Explains modular arithmetic or subtracting a key (like 13) for decryption.
    • Encourages testing intermediate outputs to verify correctness.
  • Task 5 (Musical Program from Poem):

    • Mentor helps decode poem instructions into program logic:
      • Mapping numbers to pitches.
      • Iteration loops to play sequences multiple times.
      • Syscalls to produce output (representing musical notes).
    • Emphasizes buffer management and loop counters to avoid errors.

Step 4: Testing & Debugging

  • The mentor teaches the student to run each program incrementally and check outputs.
  • Provides debugging strategies for common errors like incorrect indexing, overflow, or incorrect syscall codes.

Step 5: Documentation and Explanation

  • Mentor ensures the student includes comments explaining registers used, loops, and logic decisions.
  • This helps clarify thought process for assessment marking.

Outcome Achieved

  • Correct execution of all five programs.
  • Demonstration of strong understanding of array handling, loops, conditionals, and syscalls in MIPS.
  • Successful translation of complex creative tasks into functioning programs.
  • Learning objectives met:
    • Apply MIPS assembly concepts in practical programming scenarios.
    • Develop problem-solving skills using low-level programming.
    • Understand how to manipulate arrays and control flow structures.
    • Convert logical, creative scenarios into executable code.
    • Improve debugging, documentation, and systematic programming approaches.

Access This MIPS Assignment Sample

Looking to understand how a MIPS assembly assignment is solved step by step? Our sample solution provides a complete reference to guide your learning, including array operations, loops, and syscall implementations.

Remember: This sample is for reference only. Submitting it as your own work is considered plagiarism and can seriously affect your academic standing.

If you want a fully original, plagiarism-free assignment, our team of professional academic writers can craft a solution tailored to your exact requirements. Ordering a fresh solution ensures:

  • Step-by-step explanations aligned with your course requirements.
  • Fully verified and accurate MIPS code ready for learning and submission.
  • Peace of mind knowing your work is 100% unique and plagiarism-free.
  • Support from experts with extensive experience in assembly programming and academic standards.

Choose the way you want to learn or submit:

Download Sample Solution                  Order Fresh Assignment

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.