Welcome, Guest. Please login or register.

Author Topic: Generating .lib files  (Read 2606 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Thomas

Re: Generating .lib files
« on: March 08, 2012, 09:12:09 PM »
The OS 3.9 NDK contains amiga.lib which has stub functions for all AmigaOS functions.

Offline Thomas

Re: Generating .lib files
« Reply #1 on: March 09, 2012, 08:28:23 AM »
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:

Code: [Select]
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).