How to execute another file in Assembly 16-bits

289 views Asked by At

I was developing a simple BIOS reseter, just for learning. So I have the principal file, that's the Menu, called Reseta.com, yes, it's a model tiny without stack. And I have a A.com, where's the code to reset, So I need to execute A.com with my main program, Reseta.com, A.com was writted in Debug of DOS, and yes, I'm in Windows 98, but the programa would run on MS-DOS. I tried with Interrupt 21, like service 4Bh, 3DH, but I haven't success yet. How is the simpliest way to do it? Just call the "A.com" file, it returns to DOS with service 0 from interrupt 21. Thanks, to let it more easy to understand, I was looking for something like WinExec(); in WinAPI, but of course, in Assembly 16-bits to MS-DOS.

PS: I'm using TASM and TLINK /t to compile the code...

1

There are 1 answers

0
z0rberg's On BEST ANSWER

You sound like you'll be able to do this yourself, so I'll just give you hints.

A .com isn't much more than bytecode. You can simply load the file to RAM and then jump to it. Make sure that the code starts on a 4-byte-boundary.

Alternatively, if a soft reboot is sufficient, you could simply call int 19h in your program, which jumps to the boot loader and re-loads DOS.

(also, here's Ralf Brown's Interrupt List. This is a true classic. It might come in handy at some point. Be warned: it's gigantic.)