bespokeasm requires Python 3.9 or greater.
To install, clone this repository and install using
pip. Preferably, you have a
python virtual environment set up when you do this.
git clone [email protected]:michaelkamprath/bespokeasm.git pip install ./bespokeasm/
Once installed, assembly code can be compiled in this manner:
bespokeasm compile -c isa-config.json awesome-code.asm
Supported options to the
compile command are:
-c- File path the JSON instruction set architecture configuration file. Can also be set with the
BESPOKEASM_COMPILE_CONFIG_FILEenvironment variable. It is required to set the configuration file either by this option of the environment variable.
-o- File path to where the byte code binary image should be written. If note provided, it will default to the same file path as the input assembly file, with the file extension changed to
-s- The address of the generated code that should be the first address written to the output file. Defaults to
0. Useful when generating ROM images for a given address range.
-e- The address of the generated code that should be the last address (inclusive) written to the output file. Defaults to the maximum address of the generated byte code. If larger than the generated byte code, bytes will be padded using the binary fill value. Useful when generating ROM images for a given address range.
-f- The byte value that should be used to fill empty addresses when generating binary image of a specific size. Defaults to
-p- When present, will emit a human readable version of the compilation. Does not emit automatically generate fill bytes, but will emit bytes created via directives such as
-v- Verbose output. Can be replicated for higher levels of verbosity, for example,
-vvvwill have a more verbose output than