home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 8 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  59 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: news.UVic.CA!news
  3. From: bmury@engr.uvic.ca (Brian Mury)
  4. Subject: Re: Assembler Linking, which?
  5. Message-ID: <1490.6573T900T2844@engr.uvic.ca>
  6. Sender: news@sol.UVic.CA
  7. Nntp-Posting-Host: p18-132.dialup.uvic.ca
  8. Organization: University of Victoria
  9. X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
  10. References: <4c3l3rINNh90@newsman.murdoch.edu.au>
  11. Date: Sun, 31 Dec 95 23:23:10 GMT
  12.  
  13. >Im probably an ok asm coder, but what I cant figure out is this.
  14.  
  15. >Using asmOne that I have from aminet , Im wondering how you can
  16. >link an external object module to the asm code.
  17.  
  18. >Lets say that I wnat to call printf from asmone,
  19.  
  20. > do I incbin include/amiga.lib
  21. > or XREF XDEF or what, ..
  22.  
  23. >I know that in C it is possible to join various object.o files for use by
  24. >my c program using a program called BLINK ok, but how is it done in asmOne.
  25.  
  26. >Basically I desperately need to find out how to include obj modules
  27. >in a given package like asmone or devpac or monam? without seperately using
  28. >a program like blink!!
  29.  
  30. >Thanx in advance, Im hoping that its an eay answer.
  31.  
  32. Ok, say I've got a C program that's been compiled to an object module and is
  33. called mycprog.o. It contains a routine called mycroutine which I wish to call
  34. from assembly. I would do something like this:
  35.  
  36.         XREF    mycroutine
  37.         ...
  38.         ...
  39.         ...
  40.         bsr     mycroutine
  41.  
  42. then assemble it to an object module (say, myasmprog.o). Then link them with
  43. the linker of your choosing:
  44.  
  45. blink myasmprog.o mycprog.o
  46.  
  47. If you want to use a routine in amiga.lib, you would do something along the
  48. lines of:
  49.  
  50. blink myasmprog.o LIB amiga.lib
  51.  
  52.  
  53. --
  54. Brian Mury <b.mury@ieee.org> http://www-engr.uvic.ca/~bmury
  55. 3rd year Comp. Eng., University of Victoria, Victoria, B.C., Canada
  56. PGP key: email with subject "REQUEST PGPKEY"; Whitewater Kayak/Skydive!
  57. GE -d+ p c++++ l- u+ e+ m(++) s+/-- n+(---) h f g+ w+ t+ r-- y*
  58.  
  59.