Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Hardboy on May 21, 2003, 11:36:18 PM
-
Hey there!
Does anyone know the register convention used in Warpup?
-
Hi
I was trying to find anything for you.
Well, if you have WarpUP there is DevKit with includes.
Inside powerpc_macros.i and powepc.i you can find that:
r0 = trash
r1 = stack
r2 = base (I _think_ its base pointer for data)
r3 = library base (I guess)
r13 = local (what the hell???)
there is also convention for 68k<->PPC registers mapping in case 68k calls PPC and PPC calls 68k
Hope it helps a bit for the beginning.
Good luck
PiR
-
Add to PiR's info..
r2 is the global data pointer
r3 is indeed the base register for library calls (just like a6)
Function call:
r0, r3-r12, f0-f13, cr0 & cr1 are scratch registers
r13-r31 must be preserved
Integer / pointer parameters are passed in r4-r10. If there are more, they are passed on the stack. Note 64-bit args are passed in pairs, eg r3/r4, r4/r5 etc
float / double args are passed in f0-f12 (?) additional args on the stack
Function return:
integer / pointer return in r3
long long return in r3/r4
float / double return in f0
Be careful with r0, it has implicit special meanings with lots of instructions.
-
Goodmorning guys, great thread this. Reminded me that I am still completely stuck on PPC. I have AsmOne, is there any way to get some free header and include files, for PowerUp/WarpUp/MorphOS or anything, so I can make proper executables?
-
WarpUp comes with a devkit, just get the v5 distribution (its free AFAIK).
If you want to write ppc assembler, I suggest something like pasm which comes bundled with the vbcc C compiler.
Still, if youre using ppc, you may as well do most your work in C (unless you are a very good PPC asm coder)...
-
Whats that devkit, haven´t found that one?
Hmm, does anyone knows how pasm/vlink arranges to setup the local data pointer with the directive "sdreg"? What if you in the middle of a program likes to changes that, i.e. to another segment?
Still, if youre using ppc, you may as well do most your work in C (unless you are a very good PPC asm coder)...
It´s not really a matter of how "good" you are, but rather how much time you got. Most things takes much longer time to code in assembler than high-level.
-
@ hardboy
Develokment Kit for WarpUP was in the WarpUP archive (not separatelly). Just check it, at least for the includes.
If you cannot find it - visit haage&partner (http://www.haage-partner.com) for the last version - V5.1 - for free, or use aminet (http://www.aminet.net) (v4.0+v5.1 update).
Good luck
PiR
-
It´s not really a matter of how "good" you are, but rather how much time you got. Most things takes
much longer time to code in assembler than high-level.
Oh boy, I wonder where is the point. If you write WUP program now in
assembler it works in OS4/MOS. But if you want take an advantage of
OS4 or MOS you must rewrite everything from scratch.
But well, have fun... ;)