Questions tagged [smips]

short for: simple MIPS

MIPS (originally an acronym for Microprocessor without Interlocked Pipeline Stages) is a reduced instruction set computer (RISC) instruction set architecture (ISA) developed by MIPS Technologies (formerly MIPS Computer Systems, Inc.).

SMIPS is the version of the MIPS instruction set architecture (ISA). It stands for Simple MIPS since it is actually a subset of the full MIPS ISA. The MIPS architecture was one of the rst commercial RISC (reduced instruction set computer) processors, and grew out of the earlier MIPS research project at Stanford University.

MIPS stood for Microprocessor without Interlocking Pipeline Stages and the goal was to simplify the machine pipeline by requiring the compiler to schedule around pipeline hazards including a branch delay slot and a load delay slot. Today, MIPS CPUs are used in a wide range of devices:

  • Casio builds handheld PDAs using MIPS CPUs
  • Sony uses two MIPS CPUs in the Playstation-2
  • Many Cisco internet routers contain MIPS CPUs
  • Silicon Graphics makes Origin supercomputers containing up to 512 MIPS processors sharing a common memory

MIPS implementations probably span the widest range for any commercial ISA, from simple single-issue in-order pipelines to quad-issue out-of-order superscalar processors.

SMIPS processor specification found here.

18 questions
4
votes
2 answers

Using jump tables in MIPS (how to jump a label in JT array )

I'm tring to do a menu for my work by using a jump table. Everyting looks fine for me but below code does not works. after the "jr $s0" instruction mars gives me an error like: Error in : invalid program counter value: 268501840 I know the decimal…
kotiloli
  • 45
  • 1
  • 4
1
vote
1 answer

How do I write MIPS code for vector multiplication

Define vector mul(vector v, float t). It returns a vector by multiplying it by t. If a=4i+3j+12k then mul(a,0.5) will return 2i+1.5j+6k. Here's the code I've written: .globl main .text main: la $s0,t #loading t into s1 lw…
1
vote
3 answers

Bit Difference between 2 binary numbers in MIPS Assembly

So I have to create an MIPS assembly program that reads 2 numbers out of 2 registers ($s0 & $s1) and calculates the number of bits that these 2 numbers differ by. And stores the result in the $s2 register. I also have to fulfill all the above with…
1
vote
2 answers

Generating random words in MIPS

I want to generate random words in MIPS. I know how to generate random numbers, I just want a random word from a word bank. I have tried this but I have no idea how to print them. .data ### WORD BANK ### a0: .asciiz "computer" b1: .asciiz…
0
votes
0 answers

Multiplying in MIPS (00011 x 0110) in five bit MIPS processor

I would really appreciate somebodys help on this assignment by my proffesor. Thats all he send us and we need to send him a pdf document and i have no idea how to do it.
WHOAMI
  • 1
  • 2
0
votes
1 answer

Mips: going back to incorrect return address

I have a mini bank program written that goes calls multiple functions inside the subrouting deposit, this is the subroutine deposit: addi $sp, $sp, -8 #save space on stack addi $s3, $0, 1 #trigger s3 sw $s3, 0($sp) sw $ra, 4($sp) …
0
votes
0 answers

Understanding how string is stored in MIPS and how to count the number of characters in the string

I am a beginner in MIPS. To my understanding string is stored using directive .asciiz in MIPS, and each character in the string is stored in a byte. In order to obtain a specific character code (decimal) in the MIPS program, I will have to use lb…
Edmund Chee
  • 43
  • 1
  • 6
0
votes
0 answers

MIPS Assembly File Writing

I am trying to write to a file in MIPS assembly and it seems that I cannot get it to work. The code is straightforward, but the $v0 register returns -1 no matter what I type. I have tried other people's code and still end up getting the same…
Croder
  • 64
  • 6
0
votes
1 answer

Find the sum of the elements in array in mips assembly (using recursion)

So, this was the c++ code that I needed to translate to mips assembly. int sum( int arr[], int size ) { if ( size == 0 ) return 0 ; else return sum( arr, size - 1 ) + arr[size-1]; } And this is my attempt: .data arr: .word 5 1 2…
0
votes
0 answers

Trying to work strcpy in a linked list in mips

So I have created a linked list in which each node is 72 bytes with first 64 bytes for string, next 4 for integer and the last 4 for address in which the number are arranged in a sorted order. The first 64 bytes are reserved for the string and now I…
Paras Pandey
  • 37
  • 1
  • 4
0
votes
0 answers

MIPS program won't print out correct floating point numbers

I'm doing a homework assignment where I have to prompt the user to enter a certain amount of floating point numbers, store them in an array and print out the first number that contains duplicates. This is the accompanying code in C. void main( ) { …
Stefan S.
  • 11
  • 1
0
votes
0 answers

Storing string outside .data in MIPS

For a project we are looking for way to store strings without past by .data. Indeed we want to store them on the fly during the all execution of our program. We saw things like that at beginning of programms : .data hello : .asciiz "hello…
Erend
  • 11
  • 3
0
votes
1 answer

Understanding MIPS assembly Code

A,B,C are arrays of length 6, and the base address are found in the registers as follows: A=[0 1 2 3 4 5], Base = $t0 B=[1 3 5 7 9 11] Base = $t1 C=[0 5 2 6 3 8] Base = $t2 And now for the code itself: add $t4, $zero, $zero Loop: add $t5, $t4,…
RonaldB
  • 207
  • 1
  • 10
0
votes
1 answer

Finding Kth distinct element in an array MIPS

I am trying to write MIPS equivalent of the C code below. int arrayData[5] = { 1,2,1,3,4 }; int K = 3; int KCtr = 0; int result; bool isUnique; for (int o = 1; o < 5; o++) { isUnique = true; for (int i = 0; i < o; i++) { if…
Muhammet Ali Asan
  • 1,486
  • 22
  • 39
0
votes
1 answer

How would one go about creating a new array containing the non-zero elements from another two-dimensional array in MIPS?

I have a two-dimensional integer array A(length m, width n) saved at an Address in MIPS. Out of this array, I would like to create another array B, which only contains the non-zero values from our array A. How would one go about implementing that…
Robert Mutua
  • 67
  • 1
  • 5
1
2