Questions tagged [qtspim]

QtSpim is a user interface built on the Qt UI framework for Spim, a self-contained simulator that runs MIPS32 programs.

QtSpim is a user interface built on the Qt UI framework for Spim, a self-contained simulator that runs MIPS32 programs.

http://spimsimulator.sourceforge.net/

287 questions
2
votes
3 answers

Use of Frame Pointer MIPS

i need to convert my code from stack pointer to only use frame pointer, how can i do so? i am very new to MIPS. i have this recursion C code and its MIPS code below. i am using stack pointer , how can i change it to use frame pointer? here is my C…
Justin Homes
  • 3,739
  • 9
  • 49
  • 78
2
votes
1 answer

SPIM vs MARS for RISC

I know that MARS is missing some macros, relative to QtSpim, and does not allow overloaded macros. I would like to know from the point of view of a RISC code whether there are any worthy variations between the two, and what these are if they are…
Stack Player
  • 1,470
  • 2
  • 18
  • 32
2
votes
1 answer

MIPS Compiler Error in .data Section

When I run my simple MIPS program, I receive a compiler error on a certain line of code. This is my .data section where I initialize my variables: .data prompt1: .asciiz "Please enter the rain fall for month " prompt2: .asciiz ": " …
Archibald
  • 456
  • 1
  • 7
  • 20
1
vote
1 answer

polling through mips doesnt work after the first time you run the program (MIPS)

i made a polling sequence and when i first open the program (on QtSpim) it polls perfectly, when i reinitialize and reload the program a second time it just falls through and doesnt poll at all and have to close and reopen QTSpim for the program to…
1
vote
1 answer

Why am I getting spim: (parser) Label is defined for the second time on line 7 of file when running my program?

I'm using QtSpim to make a quick program that's supposed to perform two bitwise ori operations on some integers. When I try to assemble the program, it gives me this error message, saying I can't use the same label twice - this is the exact code…
Zonk
  • 11
  • 1
1
vote
2 answers

nested loop problem of mips:Printing a pattern and gettin an error in my code

the following mips code is of printing a number pattern like this: 1 12 123 1234 12345 i cannot find the error in my code.I don't understand what is missing. main: li $t0,1 li $t1,6 li $t2,1 li $t3,6 out: beq $t0, $t1, exit in: beq…
1
vote
1 answer

Multiplicative modular inverse using fermat's primality test (Assembly MIPS)

Receive two integers a and p and print x such that ax ≡ 1 (mod p) p is prime and a is not a multiple of p The code works perfectly in MARS, but in QTSpim it complains about overlfow (immediate value 825265 out of range) and accuses error when p and…
gmn_1450
  • 121
  • 4
1
vote
1 answer

What does li $v0,10 , in Mips?

I am just starting with Mips so this may sound simple but: When I wrote the code above without li $v0,10 instruction , I got an error message: memory adress out of bound When , I added it , it worked with no warnings. What does this…
tonythestark
  • 519
  • 4
  • 15
1
vote
0 answers

How do I get my code for addition of two numbers to work in QtSpim?

I'm new to MIPS and I've written a program to add two user-selected numbers but it's not working. It says Instruction references undefined symbol at 0x00400014. Can someone please go through my code and explain what's wrong? Thank you. .data msg1:…
1
vote
1 answer

Solving a multiplication problem in mips without using MUL command

What I want to do? Translate this code without using mul command but only the other possible commands like add, subtruct and logical shift commands. .text .globl main main: # execution starts here li $t0,19057 li $t1,123…
Costas_
  • 146
  • 1
  • 11
1
vote
0 answers

MIPS doesn't give exact value when doing mul.s

li.s $f1, 0.2 li.s $f2, 2.0 mul.s $f3, $f1, $f2 mov.s $f12, $f3 li $v0, 2 # system call 2 to print float syscall The code above gives me 0.40000001 instead of exactly 0.40000000. Is there a way to bypass this? Sorry if the problem…
Dong Cao-Huu
  • 53
  • 1
  • 8
1
vote
1 answer

Why does using $v0 register in a loop return wrong output?

The following program Given a lower and upper bound input by user, determines the min and min index within that range For the test case (lower bound: 2 upper bound: 4), I tried two different codes, with the difference marked below. The following…
goldilocks
  • 161
  • 1
  • 12
1
vote
1 answer

How do you properly read an integer input in MIPS?

The following program 1. Prints out the array 2. Given a lower and upper bound input by user, determines the min and min index within that range It runs the print array function. However, I tried tracing the registers in QTSPIM, it does not…
goldilocks
  • 161
  • 1
  • 12
1
vote
0 answers

Why can't I seem to reuse temp registers in MIPS?

The following program 1. Prints out the array 2. Given a lower and upper bound input by user, determines the min and min index within that range It runs the print array function. However, it trips when it tries to store the user input into $t0.…
goldilocks
  • 161
  • 1
  • 12
1
vote
1 answer

MIPS: Converting hexadecimal number to 32-bit binary

I'm a beginner to MIPS. I'm trying to figure out converting user's inputted hexadecimal values into 32-bit binary number, and store it to an array. Here's what I think: For example, the number is (3ABCD123), then I read this value and split every…
Chocode
  • 147
  • 9
1 2
3
19 20