Welcome, Guest. Please login or register.

Author Topic: API Question  (Read 2559 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: API Question
« on: February 15, 2008, 08:01:09 PM »
It's just like any regular program internal function call, except that it calls external (OS) function (the specifics fall into ABI, and that varies between systems so I'm not going into specifics).
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: API Question
« Reply #1 on: February 15, 2008, 08:08:39 PM »
@trekiej

Hmm reading the original post, I think you're interested to learn how AmigaOS/m68k library ABI works?

For OS/library calls the A6 typically holds the library base pointer (however, some rare calls don't need it, this is typically documented if so).

Integer arguments go to data registers, pointers to address registers, starting from D0 and A0 (except dos.library which due to legacy reasons has first argument on D1 and uses data registers for pointers too).

Varargs (variable number of arguments) are not directly supported for OS/library calls and these typically are implemeted by passing pointer to the array of the arguments in an address register (taglists for example).

Result (if any) is in D0 (again with some exceptions, dos.library, utility.library and some ARexx libraries also have some other registers returned). Some rare calls are documented to return condition code flags, too.