How omarzayedbeshir/cortex-m0-iss works
This repository is a Python Cortex-M0 Thumb instruction-set simulator. A user supplies a linked program’s readelf section dump to the CLI; it loads memory, resets the CPU from the vector table, and either disassembles .text or fetches and executes instructions. Execution dispatches decoded operations to arithmetic/control-flow and memory handlers, while SVC instructions provide guest I/O and process services. The CLI can also emit traces and reports faults or exit status. Edges follow the excerpts, SOURCE INDEX references, and README; unsampled implementation details are not inferred.
Main entry points: iss.py Simulator CLI · cpu.py CPU state and dispatch · Memory.py ROM and RAM · decoder.py Thumb decoder
Components 12
CLI and loading
- Simulator CLI
iss.py
Instruction engine
- CPU state and dispatch
cpu.py - Thumb decoder
decoder.py - Instruction model
instruction.py - ALU and branches
alu.py
Memory and services
- ROM and RAM
Memory.py - Core services
iss.py
Disassembly and tracing
- Disassembly
iss.py - Execution trace
iss.py
Other components
- User
- Program dump
- stdin stdout stderr
Connections 15
- User → Simulator CLI: runs
README.md - Program dump → Simulator CLI: provides input
README.md - Simulator CLI → ROM and RAM: loads and resets
README.md - Simulator CLI → CPU state and dispatch: runs execution
README.md - CPU state and dispatch → ALU and branches: dispatches operations
cpu.py - CPU state and dispatch → ROM and RAM: dispatches memory ops
cpu.py - Thumb decoder → Instruction model: creates instructions
decoder.py - CPU state and dispatch → Instruction model: dispatches by opcode
cpu.py - Simulator CLI → Thumb decoder: decodes for disassembly
README.md - Simulator CLI → Disassembly: prints disassembly
README.md - Simulator CLI → Core services: handles SVC calls
iss.py - Core services → ROM and RAM: reads guest memory
iss.py - Core services → stdin stdout stderr: reads and writes
README.md - Simulator CLI → Execution trace: writes optional trace
README.md - Execution trace → stdin stdout stderr: writes file
README.md