How to execute another file in an assembly of 16 bits

I developed a simple BIOS reseter, just for training. So, I have a main file that the Menu called Reseta.com, yes, this is a model, small without a stack. And I have A.com, where the code is for reset, so I need to run A.com with my main program, Reseta.com, A.com was written in Debug DOS, and yes, I'm on Windows 98, but the program will work on MS-DOS. I tried with Interrupt 21, like the 4Bh, 3DH service, but so far I have no success. What is the easiest way to do this? Just call the file "A.com", it will return to DOS with service 0 from interrupt 21. Thanks, to make it easier to understand, I was looking for something like WinExec (); in WinAPI, but, of course, in Assembly 16-bit for MS-DOS.

PS: I use TASM and TLINK / t to compile the code ...

+4
source share
1 answer

It sounds like you can do it yourself, so I'll just give you tips.

A is .comnot much more than bytecode. You can simply load the file into RAM and then go to it. Make sure the code starts with a 4-byte boundary.

Alternatively, if a soft restart is sufficient, you can simply call int 19hin your program, which goes to the bootloader and reloads DOS.

(also here is Ralf Brown's Interrupt List . This is a real classic. At some point it might come in handy. Be careful: it's gigantic.)

+2
source

Source: https://habr.com/ru/post/1665423/


All Articles