Command-line reference
python3 -m niblick SOURCE [OPTIONS]
SOURCE is a .nbl source file. The compiler resolves imports relative to
the importing file, then the repository root and NIBLICK_PATH entries.
Output
Option |
Effect |
|---|---|
|
Write |
|
Emit |
|
Link the complete runtime instead of reachable routines |
|
Disable peephole and branch-relaxation passes |
The default output paths are the source path with .asm and .hex
extensions. --no-assemble cannot be combined with --run.
Emulator
Option |
Effect |
|---|---|
|
Assemble, load, and execute the program |
|
Emulator step limit; default |
|
Print each executed instruction |
|
Maximum traced instructions; default |
|
Record OUT, OUTB, IN, and INB accesses |
|
Maximum stored I/O events; |
|
Print data RAM after execution |
|
Print UART TX, RX, and error state |
|
Print the page-15 SFRs |
--trace, --trace-io, --dump-ram, --dump-uart, and --dump-sfr
imply --run.
Reports
Option |
Effect |
|---|---|
|
Print global addresses and flash labels |
|
Write the symbol map as JSON |
|
Write the PC-to-source map as JSON |
|
Print function, runtime, flash, startup, and total word counts |
|
Print user call edges with call type and source location |
|
Print call depth, runtime stack costs, and depth warnings |
Diagnostics
Option |
Effect |
|---|---|
|
Print compiler errors as a JSON array |
The schema is documented in Diagnostics and reports.
Exit status
Status |
Meaning |
|---|---|
|
Compilation succeeded |
|
Compilation or assembly failed |
Errors are written to standard error as a single file:line:column line unless
--diagnostics-json is set.
Examples
python3 -m niblick examples/hello.nbl --run --dump-uart
python3 -m niblick examples/tetris.nbl --symbols --stack
python3 -m niblick examples/hello.nbl --map-json build/hello.map.json
python3 -m niblick examples/hello.nbl --debug-map build/hello.debug.json
python3 -m niblick examples/hello.nbl --no-assemble