Answering my previous question, any argument that is a pointer to something goes in an __a register and anything that is a direct value goes in a __d register. It appears there are roughly 7 usable pointer registers and perhaps 7-8 direct value registers per function definition.
void __saveds __asm someFunction(
register __a0 APTR ptr1,
register __a0 APTR ptr1,
register __a1 APTR ptr2,
register __a2 APTR ptr3,
register __a3 APTR ptr4,
register __a4 APTR ptr5,
register __a5 APTR ptr6,
register __a6 APTR ptr7,
/*register __a7 APTR ptr8, Seems this one is special */
register __d0 BPTR val1,
register __d1 BPTR val2,
register __d2 BPTR val3,
register __d3 BPTR val4,
register __d4 BPTR val5,
register __d5 BPTR val6,
register __d6 BPTR val7,
register __d7 BPTR val8
);
Alright folks, I have this all working fairly well. I have now run into another issue that I am not sure how to fix and I cannot, as of yet, find any docs around. When making the shared library you typically have to tag and define the functions that the library will use with register designations. But I am not sure what to do for varargs style functions
/* Typical Example */
struct Person {
STRPTR name;
SHORT age;
};
int __saveds __asm getAge(register __a0 struct Person *p) {
return p->age;
}
/** Varargs?! */
int * __saveds __asm getAges(register __a0 struct Person *first, ...) {
/* Loop through and collect the ages and return as int array */
}
Does the ... need to be tagged with a register?