Use this tag for questions related to the 32 bits version of the MIPS architecture instruction set. See also [tag:MIPS].
Questions tagged [mips32]
632 questions
5
votes
1 answer
How does the $fp and $sp register work in MIPS?
I am currently reading Computer Organization and Design by John L. Henessy for Architecture course. As far as I understood that $sp points to the most recently allocated address in the stack and $fp points to the begining of the stack. Why exactly…

cnoob
- 53
- 1
- 3
5
votes
2 answers
How to implement NOT operation in MIPS?
I am new in MIPS, and I am trying to judge whether each char in a string is an alpha. I used the ASCII code to help me to judge it, while I found there is no instruction representing larger than meaning. So I try to implement a not operation from…

jianjieluo
- 319
- 1
- 4
- 15
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…

Konstantinos T. Pantelis
- 97
- 1
- 6
5
votes
1 answer
Why does the MIPS stack pointer need to be kept double word aligned?
I have read this in a couple of places, but without fully understanding why. I understand why all instructions have to be word aligned to 4 bytes in MIPS32.
But then I read that a stack frame needs to be a multiple of 8, because the stack pointer…

Nadim Hussami
- 349
- 2
- 14
5
votes
1 answer
mmap return EINVAL when run with Valgrind
My mips32 application run against Valgrind fails in mmap function. It works fine if I run separately but when I run it against valgrind it fails with EINVAL each time.
void * mem = (uint32_t *)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,…

user4117880
- 135
- 3
- 9
5
votes
4 answers
How to perform 64-bit addition and subtraction using MIPS?
I want to perform 64-bit addition and subtraction:
v1v0(HiLo) = a1a0 + a3a2 using MIPS assembly language (a1a0(HiLo) is the first 64-bit number consists of two 32-bit numbers, and a3a2(HiLo) is the second)
and I have:
$a0 = 0xffffffff
$a1 = 0x0
$a2…

Meteorite
- 344
- 1
- 5
- 17
5
votes
3 answers
Getting result from mult in mips
I am new to assembly language, and I am really confused over multiplying.
I was reading the quick tutorial here (dead link, web archive here)
It says after I use mult $t0, $t1 the results are stored in Hi and Lo, I understand these are special…

Nick
- 1,161
- 1
- 12
- 22
5
votes
2 answers
Difference between Syscall and Traps
I am wondering if there is any difference between the MIPS syscall and trap instructions. I can't find anything involving this, so I am not sure if there is a difference. Traps seem to just be a conditional syscall, but some clarifying can be…

Alex
- 125
- 2
- 7
4
votes
1 answer
How far can the j(jump) instruction jump in memory? (MIPS)
Consider the j(jump) instruction in MIPS. How far can it jump in memory? Would it be 32bits? Can i please have an explanation.

user977154
- 1,045
- 4
- 19
- 39
4
votes
2 answers
Why can I not use li.s in MARS?
I cannot use li.s in MARS. I am new to MIPS programming and I am trying not to use any co processors. Why can I not use li.s is MARS the program? It would be very helpful is someone could lead me in a new direction!
user1026822
4
votes
2 answers
implementing a processor ( mips single cycle )
i have a mini project , in this project i need to implement a MIPS single cycle processor by Verilog.
here I write the ALU and ALUControl and FileRegister but i have a problem to implement the Pc ( program counter ) for this ... i want this Pc…

Rojin
- 365
- 1
- 4
- 14
4
votes
1 answer
How many instructions need to be killed on a miss-predict in a 6-stage scalar or superscalar MIPS?
I am working on a pipeline with 6 stages: F D I X0 X1 W. I am asked how many instructions need to be killed when a branch miss-predict happens.
I have come up with 4. I think this because the branch resolution happens in X1 and we will need to kill…

Corith
- 65
- 6
4
votes
4 answers
C++ running on PIC32 (MIPS32)
Unfortunately, my C app for PIC32 needs OO too much and I can't continue doing it in C.
Do you know any MIPS32 C++ compiler for PIC32?
Thanks

rnunes
- 2,785
- 7
- 28
- 56
4
votes
2 answers
Building a small Go program for MIPS with no hardware floating point (softfloat required)
I have small program written in go that I'm trying to cross compile to get working on a MIPS architecture machine. I've been trying to cross compile using the XGO cross compilation library but have had limited success getting my program to run…

MattLock
- 174
- 3
- 17
4
votes
1 answer
MIPS32 router: module_init not called for kernel module
I'm developing a kernel module that I want to run on my router. The router model is DGN2200v2 by Netgear. It's running Linux 2.6.30 on MIPS. My problem is that when I load my module it seems that my module_init isn't getting called. I tried to…

YSK
- 1,572
- 10
- 19