I'm working on an assembler that gets assembly code and generates machine code in a binary file.
On the other side I develop an interpreter that reads the machine code generated and interprets it.
I do something like this:
myas foo.asm -o out
myint out
(myas
is my assembler application and myint
is the interpreter application and both are nodejs applications)
Is there a way to set the program that runs the executable file in the executable file, somehow?
Instead doing myint out
I want to do ./out
(running it as executable).
If I have an executable file that I want to run with node
I put this on the first line: #!env/node
.
How can I set myint
command to run out
file?