ELEC 385: Computer System Design
1. Write a MIPS assembly language program to play the Jeopardy theme song using the
instrument of your choice and at the volume of your choice. The following assembly directives
initialize the notes of the song and duration for which each note is to be played.
Notes: .word 72,77,72,65,72,77,72,1
Dur: .word Q,Q,Q,Q,Q,Q,H,Q
You are required to use two functions (subroutines) in your solution. The following describes
the calling sequence and the passing of the arguments. Make sure you follow all MIPS
Function1(int note, int duration)
# Play note for given duration
# Delay for 400ms
This problem uses two new MARS system calls, sleep and MIDI out. See the help menu to
learn how to use each. Make sure to read the notes below the system call table for the full
description of the calls.
Comment your program. Include in your comments a list of registers used with an explanation
of how each was used. Submit a hard copy of your source file (.asm) in class on the due date.
In addition, name your source file LastName.asm and upload to Brightspace so I can test it.
2. Consider the MIPS program of Exercise 6.24, shown on page 362. Draw a picture of the
stack after each jal instruction has been executed (jal f and jal f2). Note that f2 is a
recursive function so jal f2 is executed multiple times during the execution of the program.
Make sure to indicate the contents of each stack entry (use xxxxxxxx when unknown) and
the contents of the sp register. Assume sp=0x7FFFFFFC at the start of the program. Show
all numbers in their full 8-chacter hex glory.
3. Translate the following MIPS assembly language program into machine code. Show all
your work in binary, but report the machine code for each instruction in hexadecimal.
4. Translate the following machine code into assembly language. Include register names (not
just numbers), and labels for branch and jump instructions. Assume the code starts at
5. Now that you’ve done all the handwork on the last three problems, use MARS to check
your answers. If you made any mistakes, go back and fix them. Repeat as necessary.
本网站支持 Alipay WeChatPay PayPal等支付方式
E-mail: firstname.lastname@example.org 微信号:vipnxx