Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write each of the programs in this homework and run them on your SPIM emulator.

ID: 2248554 • Letter: W

Question

Write each of the programs in this homework and run them on your SPIM emulator. DO NOT just write something in the area to the right. COMPOSE THE PROGRAMS ACCORDING TO THE DIRECTIONS AND MAKE SURE EACH RUNS PROPERLY AND GIVES THE CORRECT RESULT! Then turn in the programs when the homework is due main: text (CLO 5-Assy Lang.) Write a program to do the following: Using the li instruction, load 8 in St3, 31 in St4, and 14 in St5. Multiply the contents of St3 and St4, putting the result in St0. AND the contents of St4 and St5, putting the result in St1. OR the contents of Sti from St0, putting the result in Sa0. Output the contents of 1. o data declaration is necessary. Write down the value of $a0 on your answer sheet. Remember to end your program correctly. Output each answer of the three on a different line (i.e., do a CR/LF between each answer) Remember: You can only perform mathematical operations on data that is in registers.

Explanation / Answer

1.Write a assembly language program:

A assembly language is a low level programming language for computers , microprocessors , micro controllers and other programmable devices.

Assembly level is just a level higher than the mahine code, whereas the assembly language consists of simple codes and each code i assembly level corresponds to a machine code.

the assemble is a software which is used to convert a assembly level language into a machine level code.

The registers in assembly level language is preceeded by $ and the immediate values are preceeded by #

Now lets write the program in assembly level language:

// using li instruction load 8 in $t3 , 31 in $t4 and 14 in $t5.

// here we need to enter values in hexadecimal

Li $t3, #08h

Li $t4, #1Fh

Li $t5, #0Eh

//multiply $t3 and $t4 and put the result in $t0

LDA $t3

MUL A$t4

STA $t0

// AND $t4 and $t5 and put result in $t1

AND $t1,$t4,$t5

// OR $t1 from St0 and store result in $a0

OR $a0,$t1,$t0

END

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote