Re: A89: Running asm programs (Xavier)


[Prev][Next][Index][Thread]

Re: A89: Running asm programs (Xavier)




Thanks!!  I don't exactly understand it all, but that's expected when you ask a complicated
question.  Can I ask one more question?  Is it possible to do this without using any libs?  Like
making an independant program?  Do I just substitute the lib code in my program and call it?  Is it
okay if I do that?

And thanks again, expecially for commenting the code.

-Miles Raymond      EML: m_rayman@bigfoot.com
ICQ: 13217756       IRC: Killer2        AIM: MRayMan
http://www.bigfoot.com/~m_rayman/

-----Original Message-----
From: Xavier VASSOR <xvassor@mail.dotcom.fr>
To: assembly-89@lists.ticalc.org <assembly-89@lists.ticalc.org>
Date: Friday, January 01, 1999 7:24 AM
Subject: Re: A89: Running asm programs (Xavier)


>Miles Raymond wrote:
>
>> How do I run an asm program from an asm program?  I don't want to
>> detect any programs, I just want to run, say, Slippy.  So every time I
>> run my program, and I get to the point, it will run Slippy.  Any help
>> is greatly appreciated.
>
>OK. Let's say that you want to run Slippy with Slippy into the main
>folder (it will be more simple)
>
>Then do the following
>
> pea progname(pc) ;pushes the adress of the name of the program you
>look for
> move.w #9,-(a7) ;pushes the handle of the MAIN folder
> jsr userlib::FindSymEntry ;looks for the program VAT adress
> addq.l #6,a7 ;restores the stack
>
> cmp.l #0,a0 ;if a0 = 0, the prog doesn't exist
> beq \notfound
> move.w 12(a0),-(a7) ; pushes the handle of the program you want to run
> jsr userlib::exec ; runs the program
> addq.l #2,a7 ; restores the stack
>
> rts ;exits
>
>progname dc.b "slippy",0 ;name of the prog to run
>
>Here is it ! Do you need more precisions ?
>
>Xavier VASSOR
>---The Doors Team
>E-mail:xvassor@mail.dotcom.fr
>Doors Homepage: http://start.at/doors
>ICQ:10241721