David
David

Reputation: 1

Declare a function in assembly

I'm a newbie, I start programming at school and our professors asks us to realize a quicksort algorithm in assembly.

It is verry hard for me, could you give me a little help please. I do not even know how to declare a function with a pointer ...


For exemple the prototype of the function in C++ is : void Quicksort(int* t, int size)


In my opinion, I have to start like this but I'm not sure at all :

.text quicksort // it indicates that the variable belong to the quicksort function?

.size quicksort // same thing

:quicksort // it indicates that we declare a function named quicksort?

Assembly is verry hard ... I already did C / C++ programming in the past and it was easier to learn, if you can help me a little bit please, thanks ...

Upvotes: 0

Views: 982

Answers (1)

qwr
qwr

Reputation: 10921

There are a few basics that need to be realized.

  1. The pointer in the C++ function is for an int array. In MIPS, you define arrays by their addresses in memory.

  2. Functions are defined by setting up subroutine calls and using jal.

  3. You should understand the quicksort algorithm already.

If you cannot even get a hello world program running, then there is no use asking on here right now. You will have to learn the basics of assembly first.

Upvotes: 1

Related Questions