Questions tagged [mips]
MIPS is a RISC instruction set architecture (ISA). It is commonly used in embedded devices such as set top boxes and networking gear. Many university-level computer architecture classes use the MIPS ISA due to its relative simplicity. If your question is about MIPS assembly and machine code, also add the assembly tag.
mips
5,944
questions
2
votes
0
answers
23
views
Printing 2D array in MIPS
I have been using a few other posts on here to try and figure out what I am doing wrong but I am stuck and could use some help. I am making a game that has an 8x8 "board" (2d array) similar ...
1
vote
0
answers
24
views
Data Hazard in MIPS(RAW forwarding)
If I read and write a same register in one cycle, how to realize the Read After Write on hardware? Bypass will work but I'm wondering how to make it by trigger edge? Will it be ok if I write at the ...
1
vote
0
answers
20
views
Parsing Significand Bits Procedure MIPS
I am currently working on a MIPS program which takes in user input as a decimal then gives the sign, exponent, significand bits, truncated unsigned int, and truncated int. I'm having trouble with my ...
1
vote
0
answers
18
views
Can GCC use LTO to optimize MIPS load/store instruction pairs for linker-defined addresses that are close together
Problem Statement
Assume 32-bit MIPS I, and code written in C for an embedded system.
When loading from an externally defined variable (extern int myVar;) that comes from a symbol defined in a linker ...
0
votes
0
answers
25
views
Which tools to decompile extracted raw MIPS code
I have the extracted firmware image (image.out). It is a raw MIPS machine code, which is loaded at RAM address 0x80004000 The file contains binary data and readable text strings.
I want decompile it, ...
0
votes
0
answers
41
views
Why is my MIPS program not printing anything?
I have written the following MIPS program to print prime numbers below 1000.
# Constants
ARRAY_LEN = 1000
main:
# TODO: add your code here
li $t0, 2
li $t1, 0
li $t2, 2
li $...
0
votes
1
answer
37
views
Why LI becomes LBU opcode after MIPS assembler
I'm trying to assemble code for MIPS R2000 (MIPS I ISA).
I'm using LI pseudo instruction to initiate a register. After running the assembler on the following code:
li $v1, 1
The binary .text ends up ...
0
votes
1
answer
58
views
Converting ARM assembly to RISC-V assembly
I am trying to rewrite this code. It works perfectly for ARM assembly, but I am trying to rewrite it in RISC-V assembly. Here is the ARM code:
.text
.global main
.equ ADD1, 0x40000000
.set ADD2, ...
0
votes
0
answers
30
views
Microprocessor MIPS (Multi-cycle) - in which state is the PC value updated with PC+4?
In which state is the PC value updated with PC+4? In state S0, when the current PC instruction (mem[PC]) is read and stored in the non-architectural register Instr (IR), PC + 4 is calculated in ...
3
votes
4
answers
116
views
What syntax do I need to make the compiler put this variable on the stack?
I'm decompiling an old game that was ported to the PlayStation 2. The game was shipped as a debug build, and as a result has DWARF v1 debug data. The compiler used is Metrowerks CodeWarrior.
There's ...
2
votes
0
answers
29
views
How to work with multiple assembly code source files in SPIM
I'm learning to write assembly code at the moment using SPIM to simulate a MIPS32 environment. Reading some other posts here and elsewhere, it appears that some MIPS environments support an .include ...
0
votes
0
answers
20
views
Qtspim does not respond during new line
I was making a program for Qtspim that prints from 1 to 10 using a while statement.
It worked fine but the console output was 12345678910, so I wanted to add new lines to be fancier.
This is my code.
#...
2
votes
1
answer
57
views
Usage of recursion with array in MIPS
.data
A: .word 21 16 -12 25 -25 12 -32 -56 19 -11
.text
main:
la $a0, A #argument 1 : array address
li $a1, 10 #argument 2 : number of elements in array
jal print
...
0
votes
0
answers
30
views
MARS MIPS Assembly Code for Tree Search Algorithms
I'm working on a project, and I need help with my MIPS assembly code. The project requires implementing depth-first search (DFS) and breadth-first search (BFS) algorithms for binary trees represented ...
0
votes
0
answers
42
views
What is the mistake in this MIPS partition function?
I want to translate this function written in C into MIPS:
int partition(int f, int l) {
int pivot = v[l];
int i = f;
for (int j = f; j < l; j++)
if (v[j] < pivot)
swap(i++,j);
...