Is there some instruction in MIPS that will determine the parity of a certain bit representation? I know to determine whether a "number" has an even parity or an odd parity is to XOR the individual bits of the binary representation together, but that seems computationally-intensive for a set of MIPS instructions... and I need to do this ...
Is there a danger in using the $gp register to store a value? I guess my question is what is the true functionality of $gp and is it invoked behind-the-scenes somehow so that if I were to use it, things could go very very wrong?
Thanks,
Hristo
...
I'm trying to get my feet wet with MIPS assembly language using the MARS simulator.
My main problem now is how do I initialize a set of memory locations so that I can access them later via assembly language instructions?
For example, I want to initialize addresses 0x1001000 - 0x10001003 with the values 0x99, 0x87, 0x23, 0x45. I th...
I've run the following code snippet on the MIPS MARS simulator. That simulator is little endian. So the results are as follows:
lui $t0,0x1DE # $t0 = 0x01DE0000
ori $t0,$t0,0xCADE # $t0 = 0x01DECADE
lui $t1,0x1001 # $t1 = 0x10010000
sw $t0,200($t1) # $t1 + 200 bytes = 0x01DECADE
lw...
Hi,
I trying to understand what flags should I use when running ./configure of expat.
To compile for and embedded target running a debian based distribution on MIPS.
For example:
Do I have to tell it where the kernel source is?
Do I have to give it the architecture I'm using?
...
Thanks
Schmil
...
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 is being widely use. But the books I see that tutorials & books teach about MIPS more than all these other architectures.
Why is MIPS so popul...
Hello,
recently I've been reading some SO archives and encountered statements against x86 architecture.
http://stackoverflow.com/questions/2667256/why-do-we-need-different-cpu-architecture-for-server-mini-mainframe-mixed-cor
says "PC architecture is a mess, any
OS developer would tell you that."
http://stackoverflow.com/qu...
Hi,
I am just trying to implement multi-precision arithmetic on native MIPS. Assume that
one 64-bit integer is in register $12 and $13 and another is in registers $14 and $15.
The sum is to be placed in registers $10 and $11. The most significant word of the 64-bit integer is found in the even-numbered registers, and the least significa...
Here's the C representation of what I'm trying to do in MIPS assembly:
printf ("x=%d\n", x);
I know that I can do a syscall to easily print x= and I can also do a syscall to print the int x (which is stored in a register). However, that prints them like this (let's say x is 5):
x=
5
How can I make them print on the same l...
I'm having problems getting my processor to simulate correctly and I think I've narrowed it down to the program I'm giving it.
1. li $R1, 0
2. li $R2, 0x100
3. li $R6, 1
4. li $R8, 0
5. li $R9, 20
6. lw $R3, 0($R1)
7. lw $R4, 4($R1)
8. add $R5, $R3, $R4
9. srlv $R5, $R5, $R6
10. sw $R5, 0($R2)
11. ad...
In my MIPS32 exception handler, I want to determine whether the exception was caused by a I/O interrupt. The Cause register bits 2-6 inclusive has to be checked. What's the MIPS assembly code to determine this?
...
I'm compiling a C program for a MIPS embedded system.
GCC keeps sticking in stuff like __do_global_dtors_aux, frame_dummy, __do_global_ctors_aux.
How can I avoid that?
Resolved: I just "fixed" it by passing -nostdlib to gcc. Silly me for forgetting that
...
Hello mates from StackOverflow.
I am getting some problems on finding in which folder xspim saves a txt file... for example I tried this code locate at the bottom of this page:
http://courses.missouristate.edu/KenVollmar/MARS/Help/SyscallHelp.html
Btw, I only can create the txt if I execute xspim as root, because without permissions i...
int i ;
void set_array(int num){
int array[10];
for(i=0;i<10;i++){
array[i]=compare(num,i){
}
}
int compare(int a ,int b){
if(sub(a,b)>=0)
return 1;
else
return 0;
}
int sub(int a,int b){
return a-b;
}
anybody know how to convert to mips code
...
Hi,
why does such a instruction as
mul $t1, $v0 , 4
evaluates as expected. But
mul $t1, 4 , $v0
results in a syntax error!
I wonder why the first one works, because mul only works with registers per default, so I expect that only a solution like this will be workin
li $t1, 4 # set $t1 = 4
mul $t1, $v0 , $...
In ARM linux, the user-kernel virtual address range is divided in the ratio 3:1.
But in MIPS linux, this is usually 2:2
Does someone know what motivates this design difference ?
I have a faint idea that this has something to do with the fact that in MIPS, the TLB refill is managed in s/w and the kernel TLB entries are kind of hard...
Hello , i'm currently working with assembly language under the MIPS processor. I'm currently
using MARS simulator and for reasons unknown i get the following error message after every run:
Go: running try.s
Error in : invalid program counter value: 0
Go: execution terminated with errors.
I get this error message independent of the co...
Hello , i was wondering if there was anyway of combining two characters to form one character.
For instance, i have the character 6 and 7 , i want to combine them and make the result 67 that is saved in a register, is there any solution to this problem ?
//Thx in advance
...
okay, C++ and java i have no problem learning or what so ever
when it comes to mips it is like hell
okay i wanna learn how to read in the an array and print all the element out
here is a simple array that i wrote
int[] a = new int[20];
for(int i=0; i<a.length; i++){
a[i]=1;
}
for(int j=0; j<a.length; j++){
System.out.Println(a[i...
My problem is getting 64 bit key from user. For this I need to get 16 characters as string which contains hexadecimal characters (123456789ABCDEF). I got string from user and I reached characters with the code below. But I dont know how convert character to binary 4 bits. in
.data
insert_into:
.word 8
Ask_Input:
.asciiz...