mips

Are macro definitions compatible between MIPS and Intel C compiler?

I seem to be having a problem with a macro that I have defined in a C program. I compile this software and run it sucessfully with the MIPS compiler. It builds OK but throws the error "Segmentation fault" at runtime when using icc. I compiled both of these on 64 bit architectures (MIPS on SGI, with -64 flag and icc on an intel platfor...

Saving integers as Strings in MIPS

Hello , i was just wondering, is there any way in MIPS to store a summation of numbers as a string and later read them byte by byte, for example: the sum 657 -> sw into a .ascii directive -> later lb on the first index to get 6 (in ascii code) same with 5 and so on Is this possible ? //Thx in advance ...

Build a Cross Compiler

I'm trying to compile a c++ file and generate an asm or s file to be disassembled and run in PSIM. Whenever I try to do this I get errors. I am attempting to compile to mipsI-linux. I think I've determined that my cross compiler that was given to me is not working correctly for some reason. Can anyone give me some help building a new cro...

mipsel-gdb breakpoint from source code

It seems that gdb is failing to find breakpoints if a class is implemented in the header file. Therefore I am trying to force a breakpoint from the source. I guess I need the mips equivalent of asm("int3"). Any ideas? PS: asm("break 3") does not work ...

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 much of prefetch instructions are used, then it would impact the performance of the system. I find that we need to first have the working ...

Need suggestion on Embedded development board

Hi All, I want to learn about basic RISC architecture.After some R&D i would like to go with MIPS architecture.However i did not get good information on Embedded Development Boards with MIPS processor. It will be of great help if someone could suggest good board to start. Regards, Ramji ...

Modifying SESC Emulator (MINT)

I'm trying to get MINT to display the contents of its register file during run time. Does anyone have experience using SESC/MINT to emulate a MIPS architecture? I found a function defined in icode.cpp under .../sesc/src/libll/ that dumps the operands of the ALU and the current PC, instruction, and ALU target. I need to be able to see ...

Recursion in MIPS

I want implement a recursive program in assembly for MIPS, more specifically the well known Fibonacci function. There's the implementation in C: int fib(int n) { if(n<2) return 1; return fib(n-1)+fib(n-2); } ...

Simple MIPS Instructions and Compilers

Is it common for compilers (gcc for instance) to generate an instruction that loads some empty memory element into a register? Like... lw at,0(sp) where memory[sp + 0] = 0. This basically just places 0 into $at ($R1.) I ask because I'm looking through an executable file's hex dump (executable file is the result of the compilation of a...

Algorithmic Issue in MIPS

I'm rewriting my answer(s) to Project Euler questions in MIPS assembly, and I can't get this one to output the correct answer. I've gone over the code for the past hour, and I can't figure out what's wrong with my approach (as I am getting 33165 when the answer is a cool 200,00+ higher than that), so I figure the problem must be my shaki...

Representing numbers greater than 65535 in MIPS

It's me again! And I'm working on Project Euler again! Surprise, surprise. This time, my issue is that I am working in MIPS, and problem 2 requires numbers in excess of 65535, and i'm getting an out of range error. How can I work around that in this code? ## p2.asm ## ## Andrew Levenson, 2010 ## Problem 2 from Project Euler ## In MIPS A...

Subroutines in MIPS and other beginner silliness

I'm using Project Euler to learn MIPS, specifically using Problem 6 to learn how to use a subroutine. Unfortunately, I am doing something very wrong because my answer that I'm getting is far too large in magnitude. Is my problem here with how I am using the subroutine, or is it something else entirely? ## p6.asm ## ## Andrew Levenson, 2...

Searching for a nice way to define rules for decompiler, need advice

Hi, I am working on a very simple decompiler for MIPS architecture and as I progress I have to define lots of rules for code analysis, for example "if this opcode is lui and next opcode is addiu then return var = value" or "if this opcode is bne and it's referring to address before current - create loop definition in parsing tree". The ...

MIPS memcpy issue (i think)

I have some software that I have working on a redhat system with icc and it is working fine. When I ported the code to an IRIX system running with MIPS then I get some calculations that come out as "nan" when there should definitely be values there. I dont have any good debuggers on the non-redhat system, but I have tracked down that so...

MARS - mips simulator

Hi all, Does anyone know whether MARS (http://courses.missouristate.edu/KenVollmar/MARS/) is cycle-accurate? and if not - what is the error approximation of the total cycle-count? I need ~5% accuracy... 10x a lot, RBH ...

recursive merge sort in MIPS using stack

Hi I am trying to implement the merge sort algorithm in a very dirty manner since it was told by our teacher to do so. This program takes the input integer array from the user and prints the value of the array each time the sort is call (just for testing. Ill correct it later). It is entirely dependent on stack . I was told to first imp...

Use of mflo statement

When,where and why should the mflo statement be used in assembly language? ...

Pointer based array access in MIPS

What do we mean by the pointer based array access in MIPS? ...

Meaning of: Array1 : .word 0:20

What is the meaning of : Array1 : .word 0:20 ...

Clear instruction in MIPS: clear $t0

what does the instruction clear $t0 perform in MIPS?I mean what is the actual MIPS instruction for this pseudo-instruction? ...