This reference guide documents spasm, the command-line assembler tool for the Sparsr toolchain.
spasm)spasm is a single-binary command-line interface that compiles Sparsr assembly source files into binary executable kernel files (.spex). It wraps the native assembler engine into a standalone executable tool.
spasm <assembly-file>
| Argument | Type | Required | Description |
|---|---|---|---|
<assembly-file> |
Path | Yes | Path to the Sparsr assembly source file (.asm, .s, etc.) to compile. |
When spasm executes, it parses the input source file and writes the compiled binary output according to the following conventions:
.spex files are always written to the current working directory from which spasm is invoked..spex.Example Usage:
spasm /path/to/my_kernel.asm
Produces ./my_kernel.spex in the current working directory.
spasm reports execution status through standard output streams (stdout and stderr) and standard exit codes.
| Exit Code | Status | Description |
|---|---|---|
0 |
Success | Assembly completed successfully and output binary was written to disk. |
1 |
Failure | Invalid arguments, missing source file, or assembly compilation error. |
stderr)Usage: spasm <assembly-file>
stderr)Assembly file not found: /path/to/file.spasm
stderr)Failed to assemble the input file.
0x00000000 and 0xFFFFFFFF).spasm requires the native libsparsr_asm.so shared library at runtime. The CLI binary automatically searches for libsparsr_asm.so in the following locations relative to the spasm executable:
./libsparsr_asm.so)../lib/libsparsr_asm.so)