How lovefromhsd/basm works
basm is a pure-Bash x86-64 assembler and linker. Its documented workflow takes an assembly input and optional output path through src/basm.sh, producing an executable (default a.out). The tree identifies assembly, ELF, and linking modules, but no source excerpts were available to verify their call relationships; the detailed internal stages are therefore shown without speculative connections.
Main entry points: basm.sh CLI entry
Components 18
Command entry
- CLI entry
src/basm.sh - Bash library
lib/basm.lib.sh
Assembly
- Macro preprocessing
lib/functions/macro_preprocessor.sh - Assembly mode
lib/functions/assembly_mode.sh - First pass
lib/functions/first_pass.sh - Second pass
lib/functions/second_pass.sh - Opcode handling
lib/functions/opcodes.sh - Operand parsing
lib/functions/operand_parsers.sh
ELF and linking
- ELF header
lib/functions/build_elf_header.sh - Object generation
lib/functions/generate_elf_object_with_symbols.sh - Link collection
lib/functions/linker_collect.sh - Symbol resolution
lib/functions/linker_resolve.sh - Link layout
lib/functions/linker_layout.sh - Relocation
lib/functions/linker_relocate.sh - Link emission
lib/functions/linker_emit.sh
Other components
- User
- Assembly input
- Executable output
Connections 3
- User → CLI entry: invokes
- User → Assembly input: provides
- CLI entry → Executable output: produces