mips

MIPS: postfix expression evaluator using stack

I have implemented this in C++, so I have a general idea. The algorithm is: 1. read the expression into an array/string 2. check the ascii code for each of the entered character 3. if ascii values of entered char are in the range 48-57 then it's an integer 4. if char entered is integer - push on stack 5. if char entered is operator...

MIPS (curiosity) faster way of clearing a register?

Hello! Anyone knows which is the fastest way of clearing a register (=0) in MIPS assembly? Some examples: xor $t0, $t0, $t0 and $t0, $t0, $0 move $t0, $0 li $t0, 0 add $t0, $0, $0 Which is the most efficient? Thanks! ...

How to turn off MIPS-GCC automatic instruction reordering?

Following this question: http://stackoverflow.com/questions/3807480/weird-mips-assembler-behavior-with-jump-and-link-instruction I have a working GNU assembly toolchain for my single cycle MIPS project (no branch delay slot!). I would really prefer to write in C though. The code itself generated from the compiler does run, but I have to ...

MIPS debugging help

It seems that my understanding of MIPS fails me. What I need to do is create a program that reverses a string input from terminal, using a stack, but without using $sp. Is there anyone here that knows MIPS? Register usage t0 - theString address start t1 - stack address start t2 - temp for retrieved character t3 - counter for t0 t4 - c...

MIPS Learning Resources

Anybody aware of good resources for a MIPS beginner? Somewhere where I can find things like; Tutorials Examples Practice exercises Guides Any resource would be fine, however I would obviously prefer if it's free and online. Thanks! ...

Recursion in MIPS

I'm struggling to simply understand how to implement recursion in MIPS. I have an assignment to write a Fibonacci program and a Towers of Hanoi Program. I understand recursion and how each of them can be solved, but I don't know how to implement them in MIPS. I am completely lost and could use any help I can get. ...

Simple MIPS question, about load byte

I have the following question here .data a: .asciiz "2021" x: .byte 7,2,12 .text main: addi $t2, $0, 1 lb $t3, a($t2) Can someone explain to me, HOW the value of $t3 is 48? thanks EDIT this is an another question which is similiar, and is confusing. .data a: .word 12,-5,4,0 x: .byte 5 .text main: addi $t1, $0, 8 lw $t2, a($0) lw $t3...

Mips question, about load word

I have the following question .data a: .word 12,-5,4,0 x: .byte 5 .text main: addi $t1, $0, 8 lw $t2, a($0) lw $t3, a($t1) Can someone, what the value of $t3 will be?, How can you access, the 8th element when the array has a length of 4? ...

A simple MIPS, question

I have a question, which is kind of confusing Write the MIPS instruction whose machine language encoding is: 0000 0011 0001 1001 0100 0000 0010 1010 Your answer must use register names (like $t0) not numbers; and must specify any immediate as a signed integer in decimal. The answer, in the back has something to do with slt. Can someon...

multiplication in multicycle datapath write from stratch

I wanted to know how the processor does multiplication in a multi-cycle data-path right from the beginning i.e from Instruction Reading -> decoding the instruction-> reading register files etc. In other word I wanted to know that given the booth's algorithm for multiplication implemented separately (a circuit is given) how will you ext...