Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Warpup assembler programmming.
« 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 Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Warpup assembler programmming.
« Reply #1 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