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
0
votes
0 answers

MIPS parsing error

I just started to learn mips32 and I use QtSpim emulator on Windows 10. I get that error when I try to load the following code : .data X: .byte 5,1,4,2,8 .text .globl main main: deb: xor $t4, $t4, $t4 la $t3, X addi $t5,…
0
votes
1 answer

MIPS bne parser syntax error

I am trying to learn the MIPS assembly language for my CS class. I am struggling syntactically trying to write this program. I have looked at the other example my professor gave us and I followed it closely. I am getting an error on my branch not…
Chris McCole
  • 59
  • 2
  • 15
0
votes
0 answers

Random number MIPS assembly without syscall

Is there anyway to generate a random number with assembly MIPS without using sycall 42? Because if I use it, qtspim v9.17 says "Uknown system call: 42"
0
votes
0 answers

Unaligned address in store

I have this code and it tells me i have unaligned address in store when saving a double . Can someone please tell me what is happening?? Specifically i am getting the error message in the first sdc1 when i'm putting in the first value for A(1,1).…
Christina J
  • 79
  • 2
  • 8
0
votes
1 answer

MIPS exceptions what do they mean

I've been studying assembly lately and i can't seem to understand how the exceptions work exactly. More specific, i get the message Exception 6 occurred and ignored. Can someone please explain what exactly does this mean? I am using qtspim.
Christina J
  • 79
  • 2
  • 8
0
votes
1 answer

I/O System Call needs exit

If I do a i/o system call or more, when I finish I should do an exit call (code 10) or not is necessary? I make an example: .data input_message: .asciiz "\nEnter an integer: " .text .globl main main: li $v0, 4 …
azkidenz
  • 53
  • 1
  • 6
0
votes
0 answers

Mips split input

I am new to Mips. I want to make a calculator with MIPS. I made a research about how can I split the user input, but I could not find it. For example, input:"567/45" I want to split and load into registers like t0=567, t1=/, t2=45. Is this…
M.J.Watson
  • 470
  • 7
  • 18
0
votes
0 answers

Why do I get an endless loop in MIPS (using QTSPIM)

I'm new to MIPS and I'm trying to create a simple program, but I get an endless loop and I don't understand why. I'm trying to point to a size variable with a global pointer and load it to $s1. Here is my code: .data 0x10000000 size: .word…
Niv Goren
  • 11
  • 2
0
votes
0 answers

In MIPS Assembly language, when do you know when to use syscall?

I am not looking for a subjective answer, but rather a concrete one. I thought you were supposed to use syscall when you finish writing an instruction. However, the following code when put into QTSpim gives me the error: "Unknown System Call:…
user4351838
0
votes
2 answers

Opening file always returns "-1" in QtSpim

I'm working on a university project where we have to write Data to a file via MIPS. I get everything to run on MARS, but on QtSpim, just opening a file always returns an error: .data file_name: .asciiz "test.pgm" # # main # .text .globl…
Aram Becker
  • 2,026
  • 1
  • 20
  • 32
0
votes
1 answer

something wired about lw instruction when I use QtSpim

[00400028] 8d090008 lw $9, 8($8); lw $t1, 0x008($t0) [0040002c] 312a0002 andi $10, $9, 2 ; 5: andi $t2,$t1,0x2 [00400030] 1148fffd beq $10, $8, -12 [chkswitch-0x00400030] [00400034] 3c010001 lui $1, 1 ; 7: lw…
0
votes
1 answer

Check number of occurences of a char in a string in MIPS?

so I'm writing a simple program that prints how many times a custom char occurs in a custom string. Here is my code: .data command1: .asciiz "Please enter a sentence " command2: .asciiz "Please enter a character " count: .word…
user6627083
  • 33
  • 1
  • 4
0
votes
1 answer

Finding Kth distinct element in an array MIPS

I am trying to write MIPS equivalent of the C code below. int arrayData[5] = { 1,2,1,3,4 }; int K = 3; int KCtr = 0; int result; bool isUnique; for (int o = 1; o < 5; o++) { isUnique = true; for (int i = 0; i < o; i++) { if…
Muhammet Ali Asan
  • 1,486
  • 22
  • 39
0
votes
1 answer

My QTSPIM simulator says error, when i run this code

i am working on a class project and what i wan to do, is ask theuserfor 2 integers, when prompted by the message"please enter an integer:" and alsoto enter a character when the message"please enter an operator(+, *, -, /)" pops up. can someone…
TINA15
  • 13
  • 1
  • 10
0
votes
0 answers

Convert C to MIPS

Having trouble converting this C code into MIPS if (integers == 0 && forward != 0) { for (char *ptr = str; *ptr != ’\0’; ptr++) { if (*ptr >= ’A’ && *ptr <= ’Z’) continue; printf("%c\n", *ptr); }
MDRIV3
  • 39
  • 1
  • 6