Niblick

Getting started

  • Installation
    • Requirements
    • From PyPI
    • From a checkout
    • Optional extras
    • Verify
  • Quick start
    • Compile and run
    • Source example
    • Run in a browser
    • Inspect the build
  • Command-line reference
    • Output
    • Emulator
    • Reports
    • Diagnostics
    • Exit status
    • Examples

Language

  • Language
    • Source file
    • Entry point
    • Case and identifiers
    • Comments
    • Compilation unit
  • Syntax
    • Lexical elements
    • Program
    • Types
    • Statements
    • Expressions
    • Imports and external assembly
  • Types
    • Type spellings
    • bool
    • flashptr
    • Floating point
    • 64-bit integers
    • Struct types
  • Expressions
    • Precedence
    • Expression typing
      • Result width
      • Expected-type width floor
      • Common type
      • Multiplication result
    • Operators
      • Binary and ternary
      • Unary
    • Assignments
    • Conditional expressions
    • Address-of
    • Related
  • Semantics
    • Evaluation order
    • Initialization and lifetime
    • Arithmetic behavior
    • Conversions
    • Arrays
    • Calls and recursion
    • Unsupported operations
  • Declarations and literals
    • Variables
    • const
    • Array lengths
    • Initializers
    • Literals
    • Strings
    • Struct declarations
  • Statements
    • Blocks
    • if and else
    • while
    • for
    • break and continue
    • return
    • Expression and assignment statements
    • Inline assembly
    • Related
  • Functions
    • Declaration
    • main
    • Calls
    • Tail calls
    • Recursion
    • extern fn
    • Inlining
    • Related
  • Structs
    • Layout
    • Operations
    • Limits
    • Memory
  • Imports
    • Niblick modules
    • Merge behavior
    • Dead declarations
    • Assembly modules
    • Implicit modules
    • Errors
    • Related
  • Inline assembly
    • Placeholders
    • Labels and calls
    • Restrictions
    • Optimization
    • Results
  • Imported assembly modules
    • Extern declarations
    • Placeholders
    • Scratch RAM
    • Calls and linking
    • Labels and restrictions
    • Optimization control
    • Worked example: w5500_tx_pointer
  • Limitations
    • Unsupported syntax
    • Types and data
    • Aggregates
    • Control flow and storage
    • Library scope

Standard library

  • Standard library
    • Module index
    • Public and internal modules
    • Import resolution
    • Calling conventions
  • Intrinsics
    • Memory
    • I/O
    • UART
    • Timing
    • W5500 fast path
    • Formatting
    • Nibble helpers
    • Internal builtins
  • Print formatting
    • Placeholders
    • UART setup
  • UART
    • Setup
    • Functions
  • GPIO
    • Functions
  • Board constants
    • Output pins
    • Input pins
    • Default SPI and W5500 assignments
  • Display
    • Framebuffer layout
    • Constants
    • Functions
  • Keys
    • Key status bits
    • Key codes
    • Functions
  • Time
    • Constants
    • Functions
  • Power
    • Constants
    • Functions
  • System
    • Constants
    • Functions
  • Random
    • Functions
  • Memory
    • Constants
    • Functions
  • Strings
    • Constants
    • Functions
  • Math
    • Functions
  • Fixed point
    • Functions
  • Trigonometry
    • Constants
    • Functions
  • Audio
    • Constants
    • Functions
  • PDM
    • Functions
  • SPI
    • Functions
  • Font
    • Constants
    • Functions
  • Text scrolling
    • Functions
  • W5500 Ethernet driver
    • Register access
    • Functions

Toolchain

  • Emulator
    • Command line
    • Python API
    • Model
    • I/O tracing
    • Step limits
  • Diagnostics and reports
    • Text errors
    • JSON errors
    • Symbol maps
    • Size report
    • Stack report
    • Execution trace
    • I/O trace
    • Dumps
  • Debugging Niblick programs
    • Launch configuration
    • Operations
    • Source map
    • Debugging an existing .hex
    • Python requirements
    • Limitations
  • VS Code language support
    • Install
    • Run from source
    • Install locally
    • Features
    • File associations
    • Settings
    • Commands
    • Diagnostics
    • Architecture
    • Known limitations
  • Web editor
    • Features
    • Projects
    • Zip format
    • Emulator panel
    • Development
    • Production build
    • Tests

Internals

  • Compiler internals
    • Pipeline
    • Expression convention
    • Memory allocation
    • Imports
    • Print expansion
    • Calls and recursion
    • Optimizations
    • Reports
    • Errors
  • Runtime ABI
    • Values
    • User function calls
    • Tail calls
    • Runtime library ABI
    • User assembly modules
    • GPIO and SFR helpers
    • Memory layout
    • Call depth
    • Flash data
    • main
  • Voja4 Instruction Set Reference
    • Machine model
      • Operand notation
    • Instruction summary
      • 4-bit opcodes (bits 11..8)
      • Extended opcodes (opcode nibble 0x0)
    • Flags
    • Compiler-generated sequences
    • Code-generation notes
      • Relative jumps
      • SKIP
      • Calls, jumps and the hardware stack
      • R0-only memory access
      • Arithmetic and shifts
      • Program memory is not writable
      • Timing
  • Voja4 Memory Map
    • Data memory (0x00-0xFF)
      • Page 0: registers and fixed SFRs
      • Hardware stack (0x10-0x1E)
      • Page 15: special function registers
      • SFR access from Niblick
        • WrFlags (0xF3)
        • RdFlags (0xF4)
        • KeyStatus (0xFC)
      • Reset/default state at RUN
    • Code memory (0x000-0xFFF)
  • Soft float
    • Modules
    • Representation
    • Arithmetic behavior
    • Helpers
    • Cost
  • 64-bit arithmetic
    • Representation
    • Helpers
    • Behavior
    • Limits
  • Size and performance
    • Limits
    • Code-size budgets
    • Costs
    • Reports

Examples

  • Examples
    • Tetris controls
    • Build and run

Project

  • Repository layout
    • Key modules
    • Build outputs
  • Contributing
    • Setup
    • Checks
    • Examples
    • Documentation
    • Commits
    • Release
  • Testing
    • Fast loop
    • Test layers
    • Emulator model
    • Adding a compiler test
    • Tooling
    • CI
  • Releasing
    • Before publishing
  • Documentation style
    • Scope
    • Writing rules
    • Prohibited prose
    • Page template
    • Cross-references
    • Automated checks
Niblick
  • Search


© Copyright 2026, Mike Abbott.

Built with Sphinx using a theme provided by Read the Docs.