Answer the question
In order to leave comments, you need to log in
How to translate the code into an exe file for a language VM?
Recently, many of my projects have gone down the drain. And now I decided to write my own AP. And right away I ran into a problem. How do I translate the assembler code for my VM into an executable file (exe) and how do I make this exe work with my VM?
There is a code (VM Register if anything)
set a, 3
set b, 7
set c, 5
sum a, b, c to a
Answer the question
In order to leave comments, you need to log in
exe is a container for the operating system.
It is not clear what kind of VM you have - each operating system must support some kind of format for executable files and run it, that is,
1. create a new process
2. Load executable code from a file into memory, possibly part of the code, possibly code and some data
3. Transfer control to the entry point
How and what to load - specified in the executable file (exe, elf), or the files are made template (.com).
You are now confusing the functionality of the compiler and the linker.
If all this is easy to do, then what is the question?
In my opinion "easy" means that I know what to do, how to do it and how much to do it.
Well, of course, and you swung the translator. Maybe to start with a simple stack machine?
Well, with your input data, the answer to the question "how to do" does not imply something short
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question