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
Filter by
Sorted by
Tagged with
193 votes
13 answers
263k views

Error "gnu/stubs-32.h: No such file or directory" while compiling Nachos source code

I am trying to install Nachos on my laptop and I have Ubuntu 11.04 on the laptop. The code is in C and so to build it I assume I will need cross compiler. This is where my problem is. I downloaded ...
Ashish Agarwal's user avatar
113 votes
10 answers
41k views

Why is x86 ugly? Why is it considered inferior when compared to others? [closed]

I've been reading some SO archives and encountered statements against the x86 architecture. Why do we need different CPU architecture for server & mini/mainframe & mixed-core? says "PC ...
claws's user avatar
  • 53.2k
81 votes
6 answers
146k views

CMake: The C Compiler is not able to compile a simple test program [duplicate]

I am trying to cross-compile the Azure IoT SDK C for a Mips processor. Cross-compiling an older version of the same SDK using an older version of CMake (2.8.12.2) works just fine, so I doubt it's the ...
Kagemand Andersen's user avatar
56 votes
4 answers
89k views

What is the difference between unconditional branch and unconditional jump (instructions in MIPS)?

You may look into Wikipedia or short summary for students. Everybody says that there are two instructions for the same thing. But nobody tells why?
Val's user avatar
  • 1
56 votes
3 answers
23k views

What is MIPS system image in Android SDK manager?

With each SDK, I have a solution of installing MIPS system image. What is it? What does it do and when will someone use it? What will happen if I do not install it?
sandalone's user avatar
  • 41.5k
43 votes
1 answer
84k views

MIPS assembly language - temporary register vs saved registers

So far I have been using registers $s0-$s9 and same way as registers $t0-$t9. I have been told and read countless forum posts and paragraphs here and on Google explaining the difference, but with no ...
shawn a's user avatar
  • 799
39 votes
2 answers
169k views

Difference between "move" and "li" in MIPS assembly language

I was practicing converting C code into MIPS assembly language, and am having trouble understanding the usage of move and li in variable assignment. For example, to implement the following C line in ...
user2492270's user avatar
  • 2,245
38 votes
1 answer
29k views

Assembly Files: Difference between .a .s .asm

In the MIPS simulator "QTSpim", three types of files are accepted: .a .s .asm Is there a difference between those filetypes, and if yes, what is the difference?
Nicolas Brauch's user avatar
36 votes
4 answers
137k views

How to Calculate Jump Target Address and Branch Target Address?

I am new to Assembly language. I was reading about MIPS architecture and I am stuck with Jump Target Address and Branch Target Address and how to calculate each of them.
user avatar
32 votes
6 answers
23k views

What's the relative speed of floating point add vs. floating point multiply

A decade or two ago, it was worthwhile to write numerical code to avoid using multiplies and divides and use addition and subtraction instead. A good example is using forward differences to evaluate ...
J. Peterson's user avatar
  • 2,016
29 votes
3 answers
105k views

In MIPS, what are HI and LO

I'm reading about division in MIPS and I've found that div Divides $s by $t and stores the quotient in $LO and the remainder in $HI https://web.archive.org/web/20201111203150/http://www.mrc.uidaho....
hodgesmr's user avatar
  • 2,775
28 votes
14 answers
14k views

MIPS - Is it important? [closed]

My question: Is the MIPS programming language that beneficial to know? I'm a CS student and am taking an assembly class which focuses on MIPS. I'm very comfortable writing in high level languages, but ...
user17083's user avatar
  • 415
28 votes
7 answers
32k views

MIPS processors : Are they still in use? Which other architecture should I learn? [closed]

I've been programming for x86 & x86-64 in assembly language for few months. Now, I want to move on to some different kind of processors. MIPS, SPARC, PowerPC, Itanium, ARM of these I found ARM ...
claws's user avatar
  • 53.2k
25 votes
5 answers
34k views

What is the point of delay slots?

So from my understanding of delay slots, they occur when a branch instruction is called and the next instruction following the branch also gets loaded from memory. What is the point of this? Wouldn't ...
James's user avatar
  • 706
25 votes
5 answers
54k views

Difference between add and addu

I am confused about the difference between add and addu. The MIPS instruction reference says: add (with overflow) add unsigned (no overflow) My understanding is to use add with signed operands and ...
collimarco's user avatar
  • 34.7k
25 votes
3 answers
60k views

Different between jump and jump and link

Could someone provide an example of the usefulness of the jal instruction can how it can be used to return to the main body after completing a subroutine? regards
maxflow's user avatar
  • 909
23 votes
9 answers
32k views

Is there a way to limit an integer value to a certain range without branching?

Just out of curiosity. If I have something like: if(x < 0) x = 0; if(x > some_maximum) x = some_maximum; return x; Is there a way to not branch? This is c++. Addendum: I mean no ...
Matt Wamboldt's user avatar
23 votes
2 answers
9k views

Set all bits in CPU register to 1 efficiently

To clear all bits you often see an exclusive or as in XOR eax, eax. Is there such a trick for the opposite too? All I can think of is to invert the zeroes with an extra instruction.
Pascal de Kloe's user avatar
22 votes
2 answers
99k views

MIPS: relevant use for a stack pointer ($sp) and the stack

Currently I'm studying for my computer organization midterm, and I'm trying to fully understand the stack pointer and the stack. I know these following facts that surround the concept: It follows the ...
Connor Black's user avatar
  • 7,081
22 votes
4 answers
20k views

What should I know when switching from MIPS to x86 assembly?

At school we have been programming in MIPS assembly language for some time. I'm interested into delving into x86 assembly and I have heard that is somewhat harder (even my MIPS textbook says this). ...
mmcdole's user avatar
  • 92.1k
22 votes
2 answers
30k views

Why do we use .globl main in MIPS assembly language?

.text .globl main .ent main I don't know what .globl and .ent do. What is the role? Do I need to use globl. main and .ent main all the time?
Goodmorning's user avatar
21 votes
7 answers
42k views

Is there a way to use GCC to convert C to MIPS?

I completed a C-to-MIPS conversion for a class, and I want to check it against the assembly. I have heard that there is a way of configuring GCC, so that it can convert C code to the MIPS architecture ...
Mike's user avatar
  • 227
21 votes
3 answers
146k views

Greater than, less than equal, greater than equal in MIPS

Given two registers $s0, $s1, how can I convert the following pseudocode into MIPS assembly language using only the slt (set on less than) and beq and bne (branch if equal, branch if not equal) ...
jaynp's user avatar
  • 3,315
21 votes
3 answers
10k views

The prefetch instruction

It appears the general logic for prefetch usage is that prefetch can be added, provided the code is busy in processing until the prefetch instruction completes its operation. But, it seems that if too ...
Karthik Balaguru's user avatar
20 votes
4 answers
85k views

the functions (procedures) in MIPS

I'm new in MIPS language and I don't understand how the functions (procedures) in the MIPS assembly language work. Here are but I will specify my problem : What does: jal jr $ra mean in mips ...
Snymeh's user avatar
  • 275
20 votes
4 answers
40k views

Android emulator system images and AMD processor

I use AMD FX X6 6300 type processor. (it supports virtualization and my BIOS setting is ON) I installed "Intel x86 Emulator Accelerator". When I tried to run Intel accelerator setup, I get that setup ...
trante's user avatar
  • 33.7k
20 votes
3 answers
2k views

Valgrind on MIPS Reports no Heap Usage

I'm using valgrind (v3.10.0) to hunt down a memory leak in a complex application (a heavily modified build of net-snmp) that is being built as part of a bigger software suite. I am sure there is a ...
Woodrow Barlow's user avatar
19 votes
8 answers
27k views

How can I execute MIPS assembly programs on an x86 linux?

Are there any command line interpreters or any other set of programs around for x86 linux in order to run MIPS assembly programs? I'd like to be able to write simple MIPS assembly programs and run ...
mmcdole's user avatar
  • 92.1k
19 votes
1 answer
177k views

MIPS: Integer Multiplication and Division

So I'm building a calculator program in MIPS and I'm trying to write the multiply and divide functions. Currently I read in the integers in a loop like so: li $v0, 5 syscall and then eventually ...
Connor Black's user avatar
  • 7,081
19 votes
1 answer
82k views

What is the difference between la and li in opcodes in MIPS?

For example in this code : #display message li $v0, 4 la $a0, Message #promt user to enter name li $v0, 8 la $10, username li $a1, 20 syscall #display the name li $v0, 4 la $a0, userName syscall I ...
Mehr s.'s user avatar
  • 197
18 votes
2 answers
85k views

Assembly language (MIPS) difference betweent addi and add

I'm trying to understand the difference between using addi and add, does both do the same thing? e.g addi $t0, $0, $a0 add $t0 , $0, $a0
user2171775's user avatar
18 votes
3 answers
11k views

MIPS Decompiler [closed]

I'm looking for a decompiler capable of transforming MIPS machine code into C code. Any suggestions?
wanderingbear's user avatar
17 votes
2 answers
20k views

MIPS - JAL confusion: $ra = PC+4 or PC+8?

I'm having trouble understanding how the instruction jal works in the MIPS processor. My two questions are: a) What is the value stored in R31 after "jal": PC+4 or PC+8? b) If it's really PC+8, what ...
ReimannCL's user avatar
  • 171
17 votes
3 answers
10k views

Android os.arch output for ARM, MIPS, x86?

In order to identify the platform of an Android device, it seems that the java system property "os.arch" will suffice: Log.i("mytag", "os.arch: " + System.getProperty("os.arch")); most ARM devices ...
larham1's user avatar
  • 12k
17 votes
5 answers
52k views

Undefined reference to printf when using GCC cross compiler

I'm trying to get the following simple 'Hello World' program to compile using a cross compiler (GCC 4.9.2) targeting mips: #include <stdio.h> int main() { int x = 5; printf("x = %d\n", x); ...
pwaring's user avatar
  • 3,062
16 votes
3 answers
45k views

MIPS - How does MIPS allocate memory for arrays in the stack?

I'm quite new to the MIPS assembly language and am currently taking a class on computer architecture which has a large section on MIPS coding. I've studied several other high-level programming ...
Sam O'Mahony's user avatar
16 votes
1 answer
17k views

Adding two 64 bit numbers in Assembly

So I am learning MIPS using the SPIM simulator and im stuck on this problem. I want to add two 64 bit numbers which are stored in four 32 bit registers. So I add the LO bytes and then the carry and ...
user avatar
15 votes
1 answer
29k views

Clarifications on signed/unsigned load and store instructions (MIPS)

I can't seem to grasp the concept on these stuff, even with the help of Google and a textbook in my hand. Following the format (opcode, rs, rt, offset)... Do you sign extend the offset before adding ...
Check's user avatar
  • 153
15 votes
2 answers
15k views

Why do MIPS operations on unsigned numbers give signed results?

When I try working on unsigned integers in MIPS, the result of every operation I do remains signed (that is, the integers are all in 2's complement), even though every operation I perform is an ...
dankilman's user avatar
  • 886
15 votes
2 answers
30k views

MIPS architecture 'syscall' instruction

What is the role of syscall instruction in MIPS?
Bob Jamaica's user avatar
15 votes
2 answers
100k views

Creating (and accessing) an array in MIPS

I'm trying to create an array in MIPS Assembly, and then add all the elements together. However, when I try to assemble the following, it says Error in read_array line 1 position 7: ".word" ...
hodgesmr's user avatar
  • 2,775
15 votes
2 answers
44k views

How to cross-compile for MIPS?

I have a DVB receiver (set-top box) similar like Dreambox and it has MIPS cpu It has embedded Linux and I can connect to it with telnet Question is how to compile simple "Hello World" application in ...
davispuh's user avatar
  • 1,438
15 votes
6 answers
8k views

Regular Expressions and Assembly

I know 8086 Assembly and learning MIPS Assembly. Also, I'm learning Regular Expressions, then I want to know: How can I use Regular Expressions on them?
Nathan Campos's user avatar
15 votes
5 answers
6k views

where can I find a description of *all* MIPS instructions

Does anyone know of a web site where I can find a list of 32-bit MIPS instructions/opcodes, with the following features: Clearly distinguishes between real opcodes and assembly-language macros (...
Dan Lenski's user avatar
  • 78.2k
15 votes
1 answer
6k views

Is LLDB compatible with gdbserver (for debugging cross compiled code?)

I'm a CS student that just learned basic mips for class (Patterson & Hennessy + spim), and I'm attempting to find a mips debugging solution that allows arbitrary instruction execution during the ...
okovko's user avatar
  • 1,871
15 votes
1 answer
9k views

Dark theme for Mars 4.5 Mips?

I am using Mars MIPS Assembler and Runtime Simulator 4.5 for an assembly class and i find white background tiring when you stare at a screen for hours. I want to change the editor's color to a ...
Bill's user avatar
  • 331
14 votes
2 answers
37k views

Why doesn't there exists a subi opcode for MIPS?

I am very new to Assembly language. I was reading about MIPS architecture and came to know that you have addi opcode but there is no subi opcode. Why don't we have a subi opcode?
user avatar
14 votes
5 answers
128k views

MIPS assembly for a simple for loop

I need to translate this C code to MIPS assembly. Here is the C code: int tmp = 0; for (int j = 0; j < 15; ++j) tmp = tmp * 2 + 3 This is my MIPS assembly code. Is it a correct ...
user977154's user avatar
  • 1,075
13 votes
4 answers
89k views

MIPS Assembly - lui $t0, 4097?

Can someone explain me how does lui works, what does "4097" stand for, what does adding 8 to $t0 mean? .data 0x10010000 blank: .asciiz " " # 4097 newline: .asciiz "\n" # 4097 + 2 ...
das_tnr's user avatar
  • 151
13 votes
3 answers
27k views

What does rt stands for in MIPS instruction format?

Take MIPS instruction format described here, there are some abbreviations eg rd,rs and rt. What does rt stands for? I know rt is the second source register in R-type instruction, and is the ...
Michael Z's user avatar
  • 4,594

1
2 3 4 5
119