Message board for the users of flat assembler.
> DOS > EXEC: AX=4Bh How do I use this function?
I'm trying to make a program that executes another in pure assembly language and now I realize that I never understood very well function 4Bh of DOS (execute program). Mainly, what bothers me is that it is based upon the ancient FCB's, which I don't know how to handle. (he, he, he.... "how to handle an FCB"... what a paradox!)
Can anybody give me sample code in FASM that runs a generic EXE file using this function (or any other strategy that always works)?
«Earth is my country; science is my religion» - Christian Huygens
|21 Mar 2004, 06:02||
well, it depends on the program you want to run.
if it does use the default FCB's then you have to parse the command line (i assume you want that to be generic too) and set up the FCB's yourself. Unless there is some interrupt that can do this parsing/setup for you, no idea about that.
(One possible trick is to pass the FCB's offsets from your own PSP ,5c,6c, but it's not of much use)
OTOH if your target doesn't need FCB's (not many do) you can just pass zero filled buffers.
The requirements for function 4bh are:
- free up some memory for your target program to load/run
- set up a parameter block (this helps dos set up a PSP for the target)
I just wrote a simple example of it.
|21 Mar 2004, 10:24||
What function # ?
Ralf Brown Int List info is what?
Can't decifer request?
Here's a thought..........
turn an executable .COM into an OVERLAY by.....
Writing the file,
opening the file with your execcutable,
loading it to 0x100 (close file handle)
and calling 0x100
If you build the .COM
it can easily become the overlay, BUT
requires a RET as an ending.
FCB is extinct....................?
(I doubt I've actually helped this time?)
(it's the wine....)
|31 Mar 2004, 06:21||
< Last Thread | Next Thread >
Copyright © 1999-2019, Tomasz Grysztar.
Powered by rwasa.