Thread: PDOS for Amiga
View Single Post
Old 05 March 2021, 13:49   #58
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,302
Quote:
Originally Posted by kerravon View Post
Ok, thanks. Can I have a:

#define Read(a,b,c) (int (*)())((char *)DOSBase - 40)(a,b,c)
Trust your compiler vendor. Every amiga-aware compiler comes with a file


Code:
<pragmas/dos_pragmas.h>


which defines Read() in a way that is most convenient for the compiler. Do not roll your own, somebody else did that already for you.


Quote:
Originally Posted by kerravon View Post

I don't know how to convert:

LIBENT Read

into offset 42. No matter which direction I count from.
You don't. Your compiler vendor does that for you. Practially, every library comes with a ".fd" file which describes the entry points to the library, and every compiler comes with an "FD2Pragma" type program which creates the compiler-specific pragma file. Actually, there is an FD2Pragma in Aminet which supports most Amiga compilers. But, as said, that was already done for the dos.library, so you don't need to do that for you.


Just a matter of warning: If your program runs from the boot block of the disk, then there will be no dos.library at that point. It is rather initialized by the boot block.
Thomas Richter is offline  
 
Page generated in 0.04386 seconds with 11 queries