English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 08 August 2012, 13:30   #1
Foul
Registered User
 
Foul's Avatar
 
Join Date: Jun 2009
Location: Perigueux/France
Age: 49
Posts: 1,516
Send a message via ICQ to Foul Send a message via MSN to Foul
execute function from dos.library

hi !

I would like to use this function. if i'm not wrong, it can execute any prog.

it's code is : (http://amigadev.elowar.com/read/ADCD.../node015E.html)

Code:
success = Execute( commandString, input, output )
	   D0		   D1		 D2	 D3
Code:
 INPUTS
	commandString - pointer to a null-terminated string
	input	      - BCPL pointer to a file handle
	output	      - BCPL pointer to a file handle

    RESULTS
	success - BOOLEAN indicating whether Execute was successful
		  in finding and starting the specified program.  Note this
		  is NOT the return code of the command(s).
how can i run it ? (dos.library already opened)

Code:
move.l exec,d1
move.l file1,d2
move.l file2,d3


exec: "my prog",0
file1 : 0
file2: 0
Foul is offline  
Old 08 August 2012, 16:09   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Like this:
Code:
include include/dos/dos_lib.i

move.l  #exec, d1
moveq   #0, d2
moveq   #0, d3
move.l  dosbase, a6
jsr     _LVOExecute(a6)
ASM-One and ASM-Pro have always been a complete mess when it comes to system calls because of poor, missing or multiple system header files floating around, so if it doesn't work remove the include line and type jsr -222(a6) instead.
Leffmann is offline  
Old 08 August 2012, 16:19   #3
Foul
Registered User
 
Foul's Avatar
 
Join Date: Jun 2009
Location: Perigueux/France
Age: 49
Posts: 1,516
Send a message via ICQ to Foul Send a message via MSN to Foul
already declared execute = -222 at the beginning..

was just missing : move.l dosbase,a6 ,all the rest was correct...

Thank you
Foul is offline  
Old 08 August 2012, 16:49   #4
Foul
Registered User
 
Foul's Avatar
 
Join Date: Jun 2009
Location: Perigueux/France
Age: 49
Posts: 1,516
Send a message via ICQ to Foul Send a message via MSN to Foul
uhmm another prob:

if

exec: dc.l "myprog.exe",0

then only .exe is ran
Foul is offline  
Old 08 August 2012, 17:55   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
You need to use dc.b to define strings, with dc.l it will truncate to a longword and only keep the last 4 bytes. But it's partly ASM-Pro's fault for not warning about these things. Use a proper assembler
Leffmann is offline  
Old 08 August 2012, 17:56   #6
Foul
Registered User
 
Foul's Avatar
 
Join Date: Jun 2009
Location: Perigueux/France
Age: 49
Posts: 1,516
Send a message via ICQ to Foul Send a message via MSN to Foul
Quote:
Originally Posted by Leffmann View Post
You need to use dc.b to define strings, with dc.l it will truncate to a longword and only keep the last 4 bytes.
Found 30sec before you post lol ...

thx again
Foul is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open-source dos.library Don_Adan Coders. System 273 02 September 2020 00:42
dos.library Open() hangs MrD Coders. Asm / Hardware 15 24 July 2012 19:55
Dos.library question. Thorham Coders. General 2 11 January 2011 21:03
dos.library LockRecord() function fails LamboJay support.WinUAE 12 24 September 2010 21:05
Accessing dos.library during boot time Leffmann Coders. General 9 16 February 2009 19:26

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:55.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.14205 seconds with 13 queries