Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Archive » net.micro.pc » exec function, help wanted
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
exec function, help wanted [message #76472] Wed, 29 May 2013 23:55 Go to next message
jaap is currently offline  jaap
Messages: 11
Registered: May 2013
Karma: 0
Junior Member
Message-ID: <116@tnocsda.UUCP>
Date: Fri, 7-Sep-84 12:31:20 EDT
Article-I.D.: tnocsda.116
Posted: Fri Sep  7 12:31:20 1984
Date-Received: Sun, 16-Sep-84 12:01:17 EDT
Lines: 62


I cannot get the EXEC function working. In the example program I am trying
to execute the Personal Editor, editting the file 'test'. The EXEC function
results in executing PE, the filename is rubbish (should be test).
Exit from PE results in a hang up of the PC. Does anyone know a solution
to this problem? The DOS manual tells not much about the EXEC function.

Thanks in advance for any help
Jaap van den Eersten

EXAMPLE PROGRAM :

CMD	DB	5,' test',0DH           ; command line : edit file test
FILE	DB	'C:PE.EXE',0            ; ASCIIZ string with filename

; save locations

SAVE_SS DW	0			; save location for SS register
SAVE_SP DW	0			; save location for SP register

; parameter block

PARBLK	DW	0			; WORD segment address of environment string
	DW	OFFSET CMD		; displacement of command line
	DW	DSEG			; segment containing command line
	DW	4 DUP(0)		; no default fcb's



	PUSH	DS			; prepare return to DOS
	XOR	AX,AX
	PUSH	AX
	MOV	AX,DSEG 		; init DATA segment register
	MOV	DS,AX
	LEA	DX,FILE 		; (DS:DX) points to ASCIIZ string

	MOV	AL,0			; free memory
	MOV	AH,4AH
	MOV	BX,4
	INT	21H

	LEA	BX,PARBLK		; point (ES:BX) to parameter block
	MOV	AX,DS
	MOV	ES,AX
	MOV	AX,SS			; save SS register
	MOV	SAVE_SS,AX
	MOV	AX,SP			; save SP register
	MOV	SAVE_SP,AX

	MOV	AL,0			; call the execute function
	MOV	AH,4BH
	INT	21H

	MOV	AH,4DH			; call the wait function
	INT	21H

	MOV	AX,SAVE_SS		; restore SS register
	MOV	SS,AX
	MOV	AX,SAVE_SP		; restore SP register
	MOV	SP,AX

	RET
Re: exec function, help wanted [message #79170 is a reply to message #76472] Sun, 02 June 2013 23:11 Go to previous message
RF[1] is currently offline  RF[1]
Messages: 27
Registered: May 2013
Karma: 0
Junior Member
Message-ID: <313@wu1.UUCP>
Date: Fri, 12-Oct-84 15:02:35 EDT
Article-I.D.: wu1.313
Posted: Fri Oct 12 15:02:35 1984
Date-Received: Mon, 15-Oct-84 01:56:01 EDT
Organization: Western Union Telegraph, Mahwah, NJ
Lines: 24

Jaap van den Eersten writes:

 >>  I cannot get the EXEC function working. In the example program I am trying
 >>  to execute the Personal Editor, editting the file 'test'. The EXEC function
 >>  results in executing PE, the filename is rubbish (should be test).
 >>  Exit from PE results in a hang up of the PC. Does anyone know a solution
 >>  to this problem? The DOS manual tells not much about the EXEC function.

 >>  Thanks in advance for any help
 >>  Jaap van den Eersten

A friend (Charles Zamloot) opines that one must initialize file
control block 1 (and possibly 2 as well) before PE will open the
file properly.  PE apparently uses the DOS 1.1 file i/o
operations and therefore assumes that the file blocks are
initialized.  The program must either initialize the FCB's or
invoke COMMAND.COM with a parameter line of "/c pe test".


				Randolph Fritz
UUCPnet:			{ihnp4,decvax}!philabs!wu1!rf

"There is a universal affinity between an intoxicated traveler
and a telephone pole . . . " -- Telephony, 4 Sept. 1909
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: usq for UNIX 4.2bsd
Next Topic: Xenix Pricing
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Apr 19 20:37:26 EDT 2024

Total time taken to generate the page: 0.01396 seconds