home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!unipalm!uknet!mcsun!sunic!dkuug!imada!news
- From: breese@monet.imada.ou.dk (Bjoern Reese)
- Newsgroups: comp.sys.m68k
- Subject: Re: arbitrary entry points
- Message-ID: <1992Nov7.175644.23743@imada.ou.dk>
- Date: 7 Nov 92 17:56:44 GMT
- References: <al158305.721060111@academ01>
- Sender: news@imada.ou.dk (USENET News System)
- Distribution: comp.sys.m68k
- Organization: Dept. of Math. & Computer Science, Odense University, Denmark
- Lines: 48
-
- In article <al158305.721060111@academ01> al158305@academ01.mty.itesm.mx
- (Gustavo Cordova Avila) writes:
- > eker@loria.crin.fr (Steven Eker) writes:
- >
- > Hmmm... this sounds quite reminiscent to how we call shared run-time
- > libraries in AmigaDOS. It's something like:
- >
- > LIBNAME: db "reqtools.library",0
- >
- > OPENLIB: lea LIBNAME(pc),a0
- > move a6,$04
- > call _LVOOpenLibrary(a6)
- >
- > ; The routine at _LVOOpenLIbrary(a6) returns a pointer to
- > ; the requested library in a1 (I think). If the library isn't
- > ; in memory at the time, Exec.library (the kernel) tries to
- > ; load it from disk, from a special assignment called "Libs:".
- >
- [... Lots and lots of text deleted ...]
-
- The pointer is returned in d0, not a1.
-
- Well, you failed to mention that your "call" is a macro,
- which simply substitutes a "jmp". So we are back at a
- "JMP offset(Ax)", but this only works on the Amiga because
- all the libraries has a jump-table, which looks something
- like this: (Please note that the values in the following
- example have been made up, and does not represent the
- correct values.)
-
- --- Rought Library Template ---
- _LVOOpenLibrary EQU -6 ;_LVO = Library Vector Offset
- _LVOCloseLibrary EQU -12
-
- LibraryStart:
- ...
- jmp ... ;Some routines
- jmp CloseLibrary ;The absolute address of the
- ;CloseLibrary routine.
- jmp OpenLibrary
- LibraryBase: ;Followed by Library data.
-
- --- End of Rought Library Template ---
-
- --
-
- Bjoern Reese | Email: breese@imada.ou.dk
- Odense University, Denmark | Voice: +45 65 932 182 (private)
-