Welcome, Guest. Please login or register.

Author Topic: Warpup assembler programmming.  (Read 2477 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline HardboyTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 248
    • Show only replies by Hardboy
Warpup assembler programmming.
« on: May 21, 2003, 11:36:18 PM »
Hey there!

Does anyone know the register convention used in Warpup?
 

Offline PiR

  • Full Member
  • ***
  • Join Date: Apr 2003
  • Posts: 148
    • Show only replies by PiR
Re: Warpup assembler programmming.
« Reply #1 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
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Warpup assembler programmming.
« Reply #2 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.
int p; // A
 

Offline Prod

  • Newbie
  • *
  • Join Date: Mar 2003
  • Posts: 28
    • Show only replies by Prod
Re: Warpup assembler programmming.
« Reply #3 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?
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Warpup assembler programmming.
« Reply #4 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)...
int p; // A
 

Offline HardboyTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 248
    • Show only replies by Hardboy
Re: Warpup assembler programmming.
« Reply #5 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.
 

Offline PiR

  • Full Member
  • ***
  • Join Date: Apr 2003
  • Posts: 148
    • Show only replies by PiR
Re: Warpup assembler programmming.
« Reply #6 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 for the last version - V5.1 - for free, or use aminet (v4.0+v5.1 update).

Good luck
PiR
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: Warpup assembler programmming.
« Reply #7 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... ;)
My Amigas: A500, Mac Mini and PowerBook