Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!lunic!my!luth!d87-jmf From: d87-jmf@sm.luth.se (Jim Malmlof) Newsgroups: comp.sys.amiga.programmer Subject: Re: ARP and DICE - How to link?? Keywords: Arp,DICE Message-ID: <1486@tau.sm.luth.se> Date: 27 Feb 91 15:34:19 GMT References: <1991Feb25.121623.16551@uni-paderborn.de> Organization: University of Lulea, Sweden Lines: 143 nick@uni-paderborn.de (Martin Koch) writes: >Hello Amigos, >I would like to use the ArpFunctions in my C-Program. >I use the DICE-Compiler from Matt Dillon. But i am not >able, to link the a.lib (or also the arp.lib)(both link time >libraries) to the executable. >They are both in the Manxformat. Has anyone solved the Problem? You will need to build a glue-library for the arpfunctions. In my ADOS 1.3 version of my editor project (modified mg) I have done a glue-library for the functions I needed. I have included the source below as a start. You can modify it to your needs. If anyone decides to make a whole glue-library of it I would appreciate a copy. /Jim. >>> Source-code arp_diceglue.a ,assembled with devpac. OPT L+ * * ARP V39 Glue routines for DICE V2.03. * Only a subset of all arp calls are implemented, especially those * needed for Mmg. * * Author : Jim Malmlof * Date : 900628 * Comment: The glue routines are not effecient and could need a bit * trimming. No of regs saved needed ? Perhaps you can movem.l * all regs needed from stack ? ****************** Implemented calls *************** XDEF _ArpAllocFreq XDEF _ASyncRun XDEF _SyncRun XDEF _FileRequest XDEF _BaseName XDEF _StamptoStr XDEF _ATackOn ; Real name is TackOn changed because of dlink. XREF _ArpBase SaveRegs REG d2-d7/a2-a6 ****************** Start of code ******************* section arpglue,code INCLUDE "INCLUDE:libraries/arp_lib.i" ; ArpAllocFreq() _ArpAllocFreq movem.l SaveRegs,-(sp) ;Save regs move.l _ArpBase,a6 ;Get arpbase jsr _LVOArpAllocFreq(a6) ;Call arp movem.l (sp)+,SaveRegs ;Restore regs rts ;return ; ASyncRun(command,arg,pcb) _ASyncRun move.l 4(sp),a0 ;Command move.l 8(sp),a1 ;Arg move.l 12(sp),a2 ;pcb movem.l SaveRegs,-(sp) ;Save regs move.l _ArpBase,a6 ;Get arpbase jsr _LVOASyncRun(a6) ;Call arp movem.l (sp)+,SaveRegs ;Restore regs rts ;return ; SyncRun(filename,args,input,output) _SyncRun move.l 4(sp),a0 ;filename move.l 8(sp),a1 ;Args move.l 12(sp),d0 ;input move.l 16(sp),d1 ;output movem.l SaveRegs,-(sp) ;Save regs move.l _ArpBase,a6 ;Get arpbase jsr _LVOSyncRun(a6) ;Call arp movem.l (sp)+,SaveRegs ;Restore regs rts ;return ; FileRequest(filereq) _FileRequest move.l 4(sp),a0 ;filereq movem.l SaveRegs,-(sp) ;Save regs move.l _ArpBase,a6 ;Get arpbase jsr _LVOFileRequest(a6) ;Call arp movem.l (sp)+,SaveRegs ;Restore regs rts ;return ; BaseName(PathName); _BaseName move.l 4(sp),a0 ;BaseName movem.l SaveRegs,-(sp) ;Save regs move.l _ArpBase,a6 ;Get arpbase jsr _LVOBaseName(a6) ;Call arp movem.l (sp)+,SaveRegs ;Restore regs rts ;return ; StamptoStr(DateTime) _StamptoStr move.l 4(sp),a0 ;DateTime movem.l SaveRegs,-(sp) ;Save regs move.l _ArpBase,a6 ;Get arpbase jsr _LVOStamptoStr(a6) ;Call arp movem.l (sp)+,SaveRegs ;Restore regs rts ;return ; ATackOn(PathName,FileName) _ATackOn move.l 4(sp),a0 ;PathName move.l 8(sp),a1 ;Filename movem.l SaveRegs,-(sp) ;Save regs move.l _ArpBase,a6 ;Get arpbase jsr _LVOTackOn(a6) ;Call arp movem.l (sp)+,SaveRegs ;Restore regs rts END >>> End of source code. --- _______ | -=- | Jim Malmlof | -=- | Internet : d87-jmf@sm.luth.se | | UUCP : {uunet,mcvax}!sunic.se!sm.luth.se!d87-jmf // | | University of Lulea,Sweden. // | | Finagle's first law: \\ // Amiga /_____\ If a program works, something has gone wrong. \X/ A500 Tower