Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!bbn!uwmcsd1!ig!agate!ucbvax!USU.BITNET!FATQW From: FATQW@USU.BITNET Newsgroups: comp.sys.amiga Subject: Re: amiga.lib calls... Message-ID: <8802142146.AA04813@jade.berkeley.edu> Date: 14 Feb 88 20:40:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 45 In article <3299@cbmvax.UUCP> steveb@cbmvax.UUCP (Steve Beats) writes: >In article <8802091727.AA09035@jade.berkeley.edu> BBOURBIN@UMDD.BITNET writes: >> >> Does anyone know how to all routines in the amiga.lib library from >>assembly language? I know that the parms are passed on the stack but what >>is the procedure name that has to be called; is it in the form "LVOCreatPort" >>or is it just "CreatePort" or "_CreatePort" and does it have to be XREF'ed at >>the start of the program? > >Yes, just prefix whatever you want to call with '_LVO' ie. _LVOAllocMem. >You should XREF all library calls you use in any given module. > > Steve Er,... I think using these routines in this way just might help your Amiga along directly on a path to the GURU. There are two ways you can call those routines from assembly language. If you want a more efficient, but a teeny bit harder to program, you can use the _LVOxxxx routines, like "_LVOAllocMem". However, these are only values, they don't point to routines. You use these values as an offset into the library base pointer of the library you want to use. You pass the parameters in registers - you can find out the registers to use in the back of the RKM: Exec, or in the .fd files on the Extras disk. The other method is to use the C interfaces from assembly language. You call a routine called "_xxxx" like "_AllocMem". The registers are passed on the stack with the last one pushed first, so the first parameter is on the top of the stack when the function gets control. These routines simply load the registers with the parameters you supply, then call the appropriate _LVO offset. One more thing: The last method is the only way to access the routines built into the Amiga.lib, such as CreatePort() and the others in the exec_support library. This is because these routines don't just call _LVO routines, since there aren't any to call. Well, hope this helps, and I certainly hope you can make sense from this! Bryan Bryan Ford //// A computer does what \\\\ Snail: 1790 East 1400 North //// you tell it to do, not \\\\ Logan, UT 84321 \\\XX/// what you want it to do. \\\XX/// Email: FATQW@USU.BITNET \XXXX/ Murphy's Law Calendar 1986 \XXXX/