I would stick with the example just because that was provided to me
I implemented some of your example code but I didn't understand why would you call floor within the function floor? Could you...
Type: Posts; User: zafy
I would stick with the example just because that was provided to me
I implemented some of your example code but I didn't understand why would you call floor within the function floor? Could you...
I am still getting the same error though
I also made another change where I changed in _e
from
subi r5,r5,0
to
srli r5,r5, #1
so the log is being computed by dividing the number by 2
Okay so I implemented what you said except this part because I don't know what you mean [QUOTE]Main needs to make a call to floor, passing the parameter in...
How do I make main make a call to floor?
Also I thought I made floor a separate function.
I'm using R29 inside floor and that is the stack pointer so what do you mean that I am using a frame ptr?
So after working for a while this is the code I came up with, following the example given
.global _exit .global _open
.global _close
.global _read
.global...
Here is a link to website describing the MIPS instructions
It helps MIPS Instruction Reference
This describes the different registers in MIPS MIPS Quick Tutorial
But for a visual we were given...
The changes I made are in black comments
Please tell me if this makes sense to your guys
I've been on this forum since yesterday just exaplining my question!
Help out :)
I haven't really completed the code that I could run it on
I'm still working on this portion
But once I get this, we have been given another code that I could modify and add this in.
Basically how...
Hey guys this is the C code I've been given
unsigned int k = 47;
main(){
printf("The floor of log2 of %d is %d", k, floor-log-2(k));
}
int floor-log-2(int n)
{
if (n == 1)
So I've been working on this but no progress.
The code that I was attempting in the first post was me trying to work with this link that is closely related to what I am trying to accomplish....
Well I did compile my code and changed the function name to floor
But now I'm evem more confused. I still can't seem to figure out which Register belongs where
.file "log.c" .section ...
Hey guys I have been given a simple recursive function in C code and I have to convert it to MIPS Assembly language. We have to implement stack pointers in our assembly code.
unsigned int k =...
Hey guys,
As programmers one time or another you must have studied the computer and its hardware and software aspects. I have a question about direct memory access and was hoping you guys could...
Come on you guys are you really going to ignore me?
I've done everything you've asked. This is honestly a one minute question. I am sorry for annoying you so much in the last thread.
I've learned...
Okay code that compiles with good indentation:
#include<stdio.h>
#include <stdlib.h>
void matrix_display(int **A, int row_size1, int col_size1);
int **matrix_alloc(int row_size1, int...
function with better indentation
voidmatrix_display(int**A, introw_size1, intcol_size1)
{
inti, j;
printf("The required matrix is\n");
for(i = 0; i < row_size1; i++) {
for(j = 0; j <...
Any more suggestions guys?
You mean u want me to move it to the display function instead like this?
Now it always prints the error even if the dimensions are right
void matrix_display(int **A, int row_size1, int...
After finally completing my code. I am trying to add some standard errors. One of the errors I want to do is if the number of entries in matrix that user inputs exceeds the actual number their should...
After many strenous hours THANK GOD I got it!
still alot of glitches here and there but... it's working
thanks all
#include<stdio.h>
#include <stdlib.h>
Why isn't my multiplication function working its giving me a segmentation fault?
void matrix_multiply( int **A, int **B, int row_size1, int col_size1)
{
int mult[10][10];
int i,j,k;
...
I should free it after the second one is assigned but I dont know how I can tell if there is already a matrix. What can I do?
well at the end of the if statement of 'A' it is freed so I am guessing nothing is stored. But that free is also necessary because if a person simultaneuosly writes A 2 2 1 2 3 4 and then A 2 2 1 2 3...
okay okay so the first 2 for loops are kind of standard they define mult[i][j] like what is inside this matrix. the second for loop kindof makes sure that the row of the second matrix B is equal to...