Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Hardboy on May 21, 2003, 11:36:18 PM

Title: Warpup assembler programmming.
Post by: Hardboy on May 21, 2003, 11:36:18 PM
Hey there!

Does anyone know the register convention used in Warpup?
Title: Re: Warpup assembler programmming.
Post by: PiR on May 23, 2003, 11:03:37 AM
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
Title: Re: Warpup assembler programmming.
Post by: Karlos on May 23, 2003, 11:54:44 AM
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.
Title: Re: Warpup assembler programmming.
Post by: Prod on May 23, 2003, 12:21:10 PM
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?
Title: Re: Warpup assembler programmming.
Post by: Karlos on May 23, 2003, 12:27:29 PM
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)...
Title: Re: Warpup assembler programmming.
Post by: Hardboy on May 23, 2003, 02:50:50 PM
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?
Quote
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.
Title: Re: Warpup assembler programmming.
Post by: PiR on May 23, 2003, 04:24:08 PM
@ 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
Title: Re: Warpup assembler programmming.
Post by: itix on May 23, 2003, 07:07:15 PM
Quote

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... ;)