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
5
votes
1 answer

MIPS Assembly Alignment Align n

What does the directive .align n do in an array? To be more specific let's say that I have the following part of code: array: .align 2 .space 800 What's its importance and why not just skip it and use .space 800 This is a…
5
votes
1 answer

MIPS Assembly - Arrays?

I am absolutely brand new to assembly programming and am trying to implement the following function (in C) in MIPS: int main() { int A[5]; // Empty memory region for 5 elements int B[5] = {1,2,4,8,16}; int i; for(i=0; i<5; i++) { A[i] =…
Shannon
  • 119
  • 1
  • 1
  • 10
5
votes
3 answers

Instruction references undefined error in MIPS/QTSPIM

I am triying to count all characters in an array and i had the following error: Instruction references undefined symbol at 0x00400014 [0x00400014] 0x0c000000 jal 0x00000000 [main] ; 188: jal main .data string: .asciiz "nice…
piyuyo
  • 73
  • 1
  • 1
  • 6
4
votes
1 answer

string length for mips assembly

Whenever I run the following code: #counts length of a string .data .data string: .asciiz "Hello" printedMessage: .asciiz "The length of the string: " .text main: la $a0, string # Load address of string. jal strlen …
MCsuchNsuch
  • 256
  • 2
  • 5
  • 17
3
votes
2 answers

Is "jr $ra" required to end a MIPS assembly language program? (MARS & QtSpim behave differently!)

If you put a jr $ra at the end of a MIPS assembly language program in MARS, you will get an error message saying: invalid program counter value: 0x00000000 Example 1 below fails: .data theMsg: .asciiz "Hello World\n" .text .globl main main: …
Chris
  • 43
  • 5
3
votes
1 answer

I get the error MIPS “spim: (parser) syntax error” when running the code

I'm using a MIPS simulator. Occurs that when I'm trying to open the text file that contains my code in the simulator I am having trouble understanding why this will not run on QTSpim. I get the error spim: (parser) syntax error line 8 Code: #This…
bobbyjon
  • 31
  • 1
  • 2
3
votes
1 answer

QtSpim cuts the 2 initial chars after string reading

I've tried with both QtSpim 9.1.16 and 9.1.17, all of them "cut" the first 2 chars of an input string, setting them to 0x0, other ASCII chars are correctly saved into buffer. That's my snippet, even though other code I've found on the internet…
3
votes
2 answers

Trouble sign extending a register in MIPS

Currently I have lh $t1, 0($t1) for sign extending $t1 from 16 bit to 32 bits, but this doesn't work. Is there a simple way to sign extend registers in MIPS?
JR3652
  • 435
  • 1
  • 4
  • 13
3
votes
2 answers

When working with QtSpim, where do I see the program output and where can I input values?

I have code that I know works (it was from my professor) but I don't really understand where I 'm supposed to see the program output. I see the registers changing and such (not that I follow it completely) but the program is supposed to ask the user…
pearbear
  • 1,025
  • 4
  • 18
  • 23
2
votes
1 answer

Attempting to convert the following C Code to High Level MIPS Assembly code but no output, why?

I have already tried changing the adding more space to the stack and that didn't seem to help ro change anything also in the uppercase label function I initially had the register names as $s4, $s5, $s6 which I change to $s0, $s1, and $s2…
2
votes
0 answers

GCC porting to new target using software floating point library

I am currently trying to porting GCC-9.2.0 compiler for new architecture "SPIM" which is similar to MIPS architecture, using floating point arithmetic operation by GCC internal: 4.2 Routines for floating point emulation ([https://reurl.cc/Q3Y1jM])…
2
votes
0 answers

Run MIPS program in command line without opening QTSPIM

I want to execute a program purely through terminal without having to open QTSPIM and running the program through the GUI. Is there a way around this? I have been using SPIM for this purpose but it's outdated and has some really annoying bugs that…
Danny
  • 244
  • 3
  • 14
2
votes
1 answer

MIPS Multiplication of More Than 32 Bits

For an assignment, I need to develop a recursive algorithm were given an input string I print out the unsigned decimal integer corresponding to the base-30 number represented by the string. (a-10;b-11;...) For example: Given input:…
JabariD
  • 23
  • 5
2
votes
0 answers

why jal main error (jal 0x00000000 [main])

When I run this code,There is an error in the main and it does not operate normally. I changed the main function or thought there was a problem with the main and global main, so I repeated the correction several times. .data message: .asciiz "…
나우정
  • 21
  • 1
2
votes
2 answers

MIPS: Division algorithm (Dividing significands of IEEE-754 format) gives incorrect answer for the last 4-5 bits (LSB)

For the case where divisor>dividend, the calculated mantissa gives wrong result for the last 4-5 least significant bits. I'm trying to divide the significands/mantissa of two IEEE-754 floating point numbers. I've used this division algorithm When…
Husun
  • 29
  • 1
  • 7
1
2 3
19 20