How to call a function with to parameters in mips32

154 views Asked by At

I have a function named insertKey that take as parameters an array address and a key. So I would like to call a function named findKey inside the function insertKey using the parameters of insertKey. The code in java is:

insertKey(int hash[],int k){
    int p;
    p = findKey(hash,k)
    //do some other things
}

So in my code the register $a3 contains the address of the array and the register $a1 contains the key. This is what I have done so far:

 main:
    lw $t1,$a3
    jal insertKey

insertKey:
    move $a0,$t1

But I don't know how to call findkey from insertKey. Can anyone help?

0

There are 0 answers