From my experience of programming Assembly, there were three things always bugging me. They are control flows(loop & conditioning), FPU, and array indexing. Fortunately, I discovered that OBJASM provides some nice solutions for us. By using arrayname.ItemPtr we seem to be able to easily index any dimensions of array. However, when looking into, there is a note about ItemPtr:

Note:  The method caller has to adjust the stack when the method returns!
    What does that mean, what should the user do after
Ocall  arrayname.ItemPtr, i, j, k...
in order to  adjust the stack so to prevent stack overflow or leakage? 
Posted on 2006-11-03 22:08:48 by guidry
Hi Guidry
This note is a fossil remaining from the time when the variable argument passing was a manual task.
Currently, the job was done automatically. You will notice the "?" in the method definition within the object declaration. That means that after the dword that MUST be present, any number of parameters can follow. The count of dwords passed on method entry is in the ecx register so you can easily handle them. In the case of ItemPtr, we will have always 1 dimension (the first dword) and for every new dimension you will have the count in ecx.
Returning to the note: simply ignore it.


Posted on 2006-11-04 00:36:22 by Biterider
Removed my reply to avoid confusion.
Thanks for clearing that up Biterider :)
Posted on 2006-11-04 02:03:13 by Homer
Glad to know there is no need for us to clean the stack when  the method returns.
Thanks for your explanation.
Posted on 2006-11-05 05:31:00 by guidry