home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / m68k / 1337 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  2.1 KB

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