Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Minuous on March 08, 2012, 08:52:38 PM
-
Hello, I am doing some coding in Draco and it is missing the pragmas for certain functions that I want to use, specifically Delay() and CreateMsgPort(). Therefore the linker (SLink) is complaining about those functions. It should just be a matter of creating a .lib file with the appropriate entries. I am wondering how this is done, as they are in a binary format. Is there a tool which will do it, or at least documentation on the file format so I can manually create them? (I would imagine this would be a common issue for programmers using non-C languages such as E, Pascal, etc. and therefore likely a solved one, but I can't find anything relating to this.)
I only really need to get these 2 function pragmas working, but if it it is easy to automate then I will generate a complete set of OS3.9 .lib files for use by other Draco programmers. Thanks.
-
The OS 3.9 NDK contains amiga.lib which has stub functions for all AmigaOS functions.
-
OK, I have added this to the list of what is linked. Now it is complaining about _TimerBase, which is odd because the program does not use timer.device at all. :-(
If I could find some kind of ".lib editor" I could just remove the reference from amiga.lib.
-
A .lib file is an object module (.o file) or a collection of object modules.
It contains stub functions for system calls. For example like this:
xref _DOSBase
xref _LVODelay
xdef _Delay
_Delay:
move.l _DOSBase,A6
move.l 4(sp),d0
jsr _LVODelay(a6)
rts
LVODelay is another symbol in amiga.lib. You can replace it by the actual offset of Delay which I don't remember without reading documentation.
xref/xdef are assembler-specific commands. They might be different for your assembler, for example xtrn or something like that. xref defines an unresolved external reference (which needs to be exported by another object module) and xdef exports a global symbol (to resolve external references of other object modules).
-
Are you using TimeDelay() by any chance?
-
No, but it was using dos.library's Delay() function at one point.