flat assembler
Message board for the users of flat assembler.

Index > DOS > EXEC: AX=4Bh How do I use this function?

Thread Post new topic Reply to topic

Joined: 26 Feb 2004
Posts: 82
Location: Argentina
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!) Laughing
Can anybody give me sample code in FASM that runs a generic EXE file using this function (or any other strategy that always works)? Rolling Eyes

Ā«Earth is my country; science is my religionĀ» - Christian Huygens
Post 21 Mar 2004, 06:02
View user's profile Send private message Yahoo Messenger MSN Messenger Reply with quote

Joined: 25 Feb 2004
Posts: 50
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.


Description: simple function 4Bh example
Filename: run.asm
Filesize: 1.34 KB
Downloaded: 403 Time(s)

Post 21 Mar 2004, 10:24
View user's profile Send private message Reply with quote

Joined: 18 Jan 2004
Posts: 97
What function # ?
Tandy ?
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....)
Post 31 Mar 2004, 06:21
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.