Hi all.
Is it possible to load and execute FASM for DOS as overlay?
Is it possible to load and execute FASM for DOS as overlay?
Hi John,
what do you mean an overlay?
what do you mean an overlay?
Overlay is method of loading and executing programs (in format exe or com) in dos. (see INT 21h Fn 4b03h) The difference from execute (Fn 4b00h) is that overlay is called using normal far CALL, and return from overlay is via RET instruction not via "INT 21h Fn 4ch" of the DOS.
So, I suppose that if I change "INT 21h AX=4c00h" at the end of FASM with RET, maybe it will works. But FASM uses some strange memory modes of the processor and I don't know what will happen if it simply exits with RET.
So, I suppose that if I change "INT 21h AX=4c00h" at the end of FASM with RET, maybe it will works. But FASM uses some strange memory modes of the processor and I don't know what will happen if it simply exits with RET.
The FRM should not be a problem, but you can't simply exit with RET, because stack is not always correctly cleaned before executing exit_program in 'system.inc'. So you should store the stack pointer somewhere in memory at the beginning of program (just after the start label) and restore it before doing ret in the exit_program routine.
Thanks. Now all is clear.
I'm not sure I understood. If you mean to spawn() it, I did it and I can testimony it works great.
Yes, but what the hell is spawn()? :confused: :stupid:
spawn() is a C function for calling a program.