mips

Print the letters of the word in MIPS

Hello, please help me to write program in assembly (MIPS) I have a word "hello!" and I need the mips prints next: h he hel hell hello hello! I tried this: .data lbl1: .asciiz "hello!" lbl2: .asciiz "h " end_line: .asciiz "\n" .text main: la $s0, lbl1 move $a0, $s0 addi $v0, $zero, 4 syscall jr $ra but it...

GNU assembler for MIPS: how to emit sync_* instructions?

MIPS32 ISA defines the following format for the sync instruction: SYNC (stype = 0 implied) SYNC stype here, stype may be SYNC_WMB (SYNC 4), SYNC_MB (SYNC 16), etc. In inline assembler, I may use default sync: __asm__ volatile ("sync" ::);. But, if I write something like __asm__ volatile ("sync 0x10" ::), it doesn't compile: Error: ...

label execution in MIPS

This is a really easy question, but if I have a bunch of instructions written for MIPS (although I assume this probably carries over to assembly in general), and there is a label at some point, does the instruction at that label get executed even if it's not explicitly called? For instance, let's say I have: SUB $6, $4, $3 BNE $6, $2, ...

Mips Architecture Pipelining forwarding

Mips Architecture Pipeline fowarding: Out of ten instructions, I don't understand these two Can someone explain? First one: Pipeline register containing source instruction: EX/MEM Opcode of Source instruction: Register-register ALU Pipeline register containing destination instruction: ID/EX Opcode of destination instruction: Register...

Porting Linux kernel 2.6 to new MIPS board

I wanna port Linux kernel 2.6.x to new MIPS board. Unfortunatelly, I can't find good actual documentation with step by step explaination. Hope, you'll help me. Paper books are OK too. Thank you in advance! ...

MIPS programming issue

Hello all. I'm having a MIPS issue here. What I'm trying to do is have the user input any number and have the program spell out the name of each digit in the number. So for example, the user inputs 495 and the machine would spell out "Four Nine Five". I'm trying to push each digit of the number onto the stack, then pop each one off. ...

Mips Assembly Language

How to convert following C conditional statement in MIPS? if (A<=B || B == D) where suppose A is stored in $t2, B in $t4, D in $t6 ...

Counting the number of bits that are set

I want to count the number of bits in a binary number that are set. For example, user enter the number 97 which is 01100001 in binary. The program should give me that 3 bits are set using MIPS ISA. I am able to achieve this in C, but I don't know how to achieve it using assembly code. Any ideas? Thanks in advance for all the help. ...

Weird MIPS assembler behavior with jump (and link) instruction.

So, we're studying MIPS architecture at school and we're implementing a MIPS32 architecture. I thought I'd use GNU cross-binutils as assembler but I'm getting weird output when dealing with instructions jal, j and jr. The assembler seems to insert the instructions at the wrong places. I have no idea why this happens, and I doubt the MIPS...

How do I load my program into a specific location in memory?

Hi Guys , I have a assembly language code ,I want to put it into a particular location at memory.The idea is basically when I finish running a code it jumps to the memory location where my other program is stored.So.what instruction/assembler directive I use to put it the desired memory location? ...

Loading an address in MIPS64.

This is probably a simple, obvious thing I'm just not seeing, but how do I load an address in a MIPS64 processor? In a MIPS32 processor the following assembler pseudo-instruction: la $at, LabelAddr Expands into: lui $at, LabelAddr[31:16] ori $at,$at, LabelAddr[15:0] Looking at the MIPS64 instruction set, I see that lui still loads...

Converting Decimal to Binary and Printing in MIPS

Hello, I'm writing a simple snippet of code for an assignment and I need to convert a decimal number to binary, octal, and hexadecimal. I have it working, but I realized afterwards that because of the algorithm I'm using, I print the binary number backwards. The strategy I was using was to print one digit at a time. I'm still a beginn...

MIPS simulator of object files

Hi, i need some MIPS simulator who can work with object files .elf or .o. I have some mips object files, and I want to simulate those files. Is this possible? ...

How can I translate this pseudocode expression to MIPS assembly language code?

Translate the following pseudocode expression to MIPS assembly language code. Include code to ensure thta there is no array bounds violation when the store word (sw) instruction is executed. Note that the array "zap" is an array containing 50 words, thus the value in resister $s0 must be in the range from 0 to 49. Be sure to convert the ...

double precision integer subtraction with 32-bit registers(MIPS)

I am learning computer arithmetic. The book I use(Patterson and Hennessey) lists the below question. Write mips code to conduct double precision integer subtraction for 64-bit data. Assume the first operand to be in registers $t4(hi) and $t5(lo), second in $t6(hi) and $t7(lo). My solution to the answer is sub $t3, $t5, ...

Convert java to mips

//***********************************************************************// // // //**********************************************************************// package javaapplication1; public class Main{ public static void main(String args[]){ // declare two arrays of char char []a ; char []b; // Two Strings to be ch...

Convert java to mips

Comparing each character in the first string with the character at the same index in the second string and compute the number of different characters in the two strings. (ex. Strings_ Difference("atalk","took")= diff is = 5 and Compute the difference between the two strings in length.(ex. Strings_Difference("tall","talls") =1 becaus...

How to convert this java code to mips

Possible Duplicate: Convert java to mips i write this code in java now i want to convert it to mips i dont learn mips can any help me ???????? now explain code this code is to Comparing each character in the first string with the character at the same index in the second string and compute the number of different characte...

MIPS Register comparator

Given two input registers in MIPS: $t0, $t1 How would you figure out which one is bigger without using branches? ...

I'm trying to run a test routine to test with my pseudocode but I doens't run. I'm I using the right code?

# Look ay my pseudocode for main routine has been written for y # # ############################################################################ # Ones counter # The user will type in an integer. # the program will pass the integer to a function that will count the # number of binary bit...