Questions tagged [pcspim]
57 questions
2
votes
0 answers
Order of delay slots MIPS
Supposed we have a load instruction followed by another load instruction, then what is the order of execution?
Example:
lui $t0, 0x1000 #(1)
lbu $t1, ($t0) #(2)
addi $t0, $t0, 1 #(3)
I tested it with Spim, the result was in order (1) ->…

PiD
- 31
- 5
2
votes
1 answer
How to make Most Significant Bit of a binary number= 1
How can I make MSB of a binary number equal to 1 in MIPS? I have tried to do it with masking but I am getting error, so is there another way to do it?
The code for making MSB=1 by masking which is giving me error.
srl $s3,$s3,1
// error out of…

Naruto
- 1,710
- 7
- 28
- 39
2
votes
3 answers
using multiple mips arguments >4
Im trying to program a function to use extra arguments besides 4 (since my version of mips only supports $a0-$a3) by pushing them on the stack, but my code is incorrect. Here is my code in main (snippet):
li $t0,40 #temp value for our 5th arg.
addi…

jfisk
- 6,125
- 20
- 77
- 113
1
vote
0 answers
MIPS assembly - simple query on how to make the numbers inputted into an array
Below is the code I have which does work. It inputs and stores the numbers the user types (can only be a list of 3 or 4 numbers).
However, this is really long and using an array index would be a lot less code and use less registers but I am uunsure…

george767
- 11
- 1
- 4
1
vote
1 answer
User input problems
I've literally just started programming in assembly language this week and I'm having some trouble. I'm making a program in MIPS using PCSpim and the program prompts the user to enter two non-negative integers. For some reason though, my code…

BleuCheese
- 41
- 1
- 7
1
vote
1 answer
spim simulator pcspim : error setting value at an address
Hi I am using spim simulator pcspim and I am trying to set a value at an address using the set value option under the simulator menu.
When I try to set a value which has an msb of 1 for ex. oxb1234567 the value at that address is defaulted to…

koool
- 15,157
- 11
- 45
- 60
1
vote
2 answers
Spim Instruction division
[0x00400000] 0x3c011000 lui $1, 4096 ; 5: li $t0, 0x100000F4
[0x00400004] 0x342800f4 ori $8, $1, 244
[0x00400008] 0x8d100000 lw $16, 0($8) ; 6: lw $s0, 0($t0)
the above is my spim program, I am…

coool killer
- 23
- 1
- 5
1
vote
0 answers
MIPS: Printing vowel and consonant count of a string
I have the program working, my only issue is the loop runs one extra time than it should which increments the consonant count one too many times. I can of course get around this by just subtracting 1 from the count at the end but I am curious why it…

Nicholas Kelly
- 11
- 1
1
vote
1 answer
MIPS architecture loop help required
Complete the SPIM assembly language program loop2.s.
The program will calculate the sum of the elements in "numbers"
whose value is less than or equal to 1000.
I tried to program the code, however the output is coming , whereas i need it to be…

Anonymous User
- 7
- 2
1
vote
1 answer
Syntax error in MIPS?
So, I'm currently learning MIPS for my Uni degree and I've came across a syntax error that is bugging me, I can't seem to put my finger on where I went wrong, my piece of code is one where a user enters two numbers, and the console is supposed to…

AlonErebos
- 17
- 6
1
vote
0 answers
PCSpim - MIPS - Exception 5 Error address error in store
so I've come across a problem with my PCSpim program, after looking I still cannot find the right solution, I thought it may be the 'align' directive, either I'm missing one or I am missing it.
Here is the beginning of the program, initializing the…

Michael abdo
- 3
- 3
1
vote
1 answer
1
vote
1 answer
PCSpim Text Window - What Does the Output Mean?
In PCSpim, when a program is executed, it displays in the Text Window a line for each instruction.
e.g. [0x00400028] 0x34020004 ori $2, $0, 4 ;13: li $v0, 4
That example loads 4 into the register $v0.
What does the ori $2, $0, 4 mean?
And is…

user6336941
- 39
- 8
1
vote
0 answers
Spim Syntax Parser Error
I have been working on this translation from HLL to MIPS AL for awhile now and I cannot figure out why I'm getting these syntax errors. I'll post the HLL I'm translating from and what is hopefully my near complete MIPS AL code.
HLL:
My Current MIPS…

CFalco
- 19
- 5
1
vote
1 answer
Calculating Prime Numbers in MIPS Assembly
I am currently working on a program that calculates the prime numbers up to 200 using recursion in MIPS assembly using PCSPIM. So far, I have populated an array of numbers from 1-200 and a binary vector list that consists of all 1's successfully.…

dhint4
- 1,132
- 2
- 11
- 25