[Solved] Creating an Exe file With only 1’s and 0’s: Machine Code [closed]


I think you would have a better experience if you used a text editor, typed either binary (ones and zeros) or hex into a text file then write a small program that reads that ascii file and saves it as the binary bits or bytes you intended. Basically making a machine code assembler.

You should specify the processor and operating system you are interested in before taking this further. You not only have to know the opcodes/machine code for the instruction set but need to know the binary file formats for the operating system (coff, elf, exe, etc) and would need to hand code all of that information (much better suited to have your machine code assembler create that header for you if needed).

As an example take http://github.com/dwelch67/lsasim an educational instruction set with simulator and tools that I created. The “binary file format” is an ascii file with the machine code in readable hex. The simulator reads that and executes it, and if desired (which is how I tested it at first), you can hand code the machine code instead of assembly language. I dont have an operating system, etc, the parser that reads the machine code file turns it into a buffer of binary ones and zeros, which is the simulated memory for the processor.

In the old days of dos and windows the debug command line program made this kind of thing easy, hand code either assembly or machine code bytes, and when you save you can easily save to a .com executable file. I am certain I am not the only one that learned x86 assembly language using debug as I couldnt afford to buy software tools like masm, and didnt have a modem to get whatever the popular free assembler was asm86 or some such thing (until years later when I could afford one of those). if debug is still part of the windows command line you can probably still do this today with that tool.

0

solved Creating an Exe file With only 1’s and 0’s: Machine Code [closed]