Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS 254 PROGRAMMING ASSIGNMENT #4 Write a program that computes 23*x. Do this by using register $7 for x and register $10 for the final

image text in transcribedCS 254 PROGRAMMING ASSIGNMENT #4 Write a program that computes 23*x. Do this by using register $7 for x and register $10 for the final result. Load $7 at the start of the program with an ori instruction. Assume that bit patterns represent positive integers using unsigned binary. Do the multiplication by shifting and adding. Notice that 23*x is equal to 16*x + 4*x + 2*x + x. Don't use explicit multiply instructions. Do use the addu and maybe the addiu instructions. Don't do input or output or loading and storing from memory. The instructions up through chapter 13 are enough. Put the result in register $10 at the end of the program. Write the program so that the value for x can easily be changed by editing the ori instruction at the beginning of the program. Execute your program by repeated "single steps" through the machine code. At the end, $10 should hold the value you expect. Use Set Run Parameters to start the PC at 0x00400000. Create your source file using Notepad++ or other text editor. Align columns, do not use tab characters. Set the option of your editor to use space characters when the tab key is pressed. Every assembly language statement should be documented in a way that explains what it is doing in terms of the problem. Start your source file with ## CS 254 Program 4 ## ## Compute 23*x ## ## Programmer: ## Date: Following this, include a register use table. Set SPIM options to the following. ON Bare machine ON Enable Delayed Branches ON Enable Mapped I/O OFF Load Exception Handler OFF Accept Pseudo Instructions ON Enable Delayed Loads Set these options as specified or SPIM will start up with options you dont want. You may have to set the options, close SPIM, and then restart it for the options to have an effect. Use only those instructions that have been discussed in the notes through chapter 13. Include a register use table in the documentation at the top of your source program. The source program should be nicely formatted. Labels (symbolic addresses) should start in column one. Nearly every line of the program will have a meaningful comment. All comments should start in the same column, perhaps column 35. Upload your source file to Blackboard.

CS 254 PROGRAMMING ASSIGNMENT #4 Write a program that computes 23*x. Do this by using register $7 for x and register $10 for the final result. Load $7 at the start of the program with an ori instruction. Assume that bit patterns represent positive integers using unsigned binary. Do the multiplication by shifting and adding. Notice that 23*x is equal to 16*x + 4*x + 2*x + x. Don't use explicit multiply instructions. Do use the addu and maybe the addiu instructions. Don't do input or output or loading and storing from memory. The instructions up through chapter 13 are enough. Put the result in register $10 at the end of the program. Write the program so that the value for x can easily be changed by editing the ori instruction at the beginning of the program. Execute your program by repeated "single steps" through the machine code. At the end, $10 should hold the value you expect. Use Set Run Parameters to start the PC at 0x00400000. Create your source file using Notepad++ or other text editor. Align columns, do not use tab characters. Set the option of your editor to use space characters when the tab key is pressed. Every assembly language statement should be documented in a way that explains what it is doing in terms of the problem. Start your source file with ## CS 254 Program 4 ## Compute 23*x # Programmer: ## Date: CS 254 PROGRAMMING ASSIGNMENT #4 Write a program that computes 23*x. Do this by using register $7 for x and register $10 for the final result. Load $7 at the start of the program with an ori instruction. Assume that bit patterns represent positive integers using unsigned binary. Do the multiplication by shifting and adding. Notice that 23*x is equal to 16*x + 4*x + 2*x + x. Don't use explicit multiply instructions. Do use the addu and maybe the addiu instructions. Don't do input or output or loading and storing from memory. The instructions up through chapter 13 are enough. Put the result in register $10 at the end of the program. Write the program so that the value for x can easily be changed by editing the ori instruction at the beginning of the program. Execute your program by repeated "single steps" through the machine code. At the end, $10 should hold the value you expect. Use Set Run Parameters to start the PC at 0x00400000. Create your source file using Notepad++ or other text editor. Align columns, do not use tab characters. Set the option of your editor to use space characters when the tab key is pressed. Every assembly language statement should be documented in a way that explains what it is doing in terms of the problem. Start your source file with ## CS 254 Program 4 ## Compute 23*x # Programmer: ## Date

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

Understand the basic elements of the promotion mix.

Answered: 1 week ago