ExampleProgram - muneeb-mbytes/computerArchitectureCourse GitHub Wiki

Example Code for Multiplication of 3 Registers

Code:

main: li $t0,23
li $t1,35
li $t2,47
mul $t3,$t0,$t1
mul $t3,$t3,$t2
move $a0,$t3
li $v0,1
syscall
li $v0,10
syscall

Steps to run it in Qtspim:

1. Copy the code in notepad and save it ->C Drive > Program Files (x86) >Qtspim> Code(program 1)

image

2. Open Qtspim and load the program 1 file from the same previous path.

image

3. Once the program is loaded, go to the simulator -> Run/continue to run the program.

image

4. We can check the Output in the console.

image