A comprehensive toolchain for the SIC/XE (Simplified Instructional Computer - Extended) architecture, featuring a two-pass assembler, linker, loader, disassembler, and an interactive TUI-based debugger.
- Two-Pass Assembler: Generates symbol tables and object code with full support for SIC/XE instruction formats
- Loader: Parses and loads object programs into memory
- Disassembler: Converts object code back to assembly mnemonics
- Interactive Debugger: Terminal-based UI for step-by-step execution and real-time state inspection
- Complete Instruction Set: Supports all SIC/XE instructions (Format 1, 2, 3, and 4)
- Addressing Modes: PC-relative, base-relative, immediate, indirect, and indexed addressing
- Assembler Directives: START, END, BYTE, WORD, RESB, RESW, BASE, and more
- Rust 1.70 or higher
- Cargo package manager
git clone https://github.com/SWASTIC-7/HexE
cd HexE
cargo build --releaseAssemble and simulate a source file:
cargo run -- program.asmLoad and simulate an object program:
cargo run -- program.txtThe interactive debugger provides real-time visualization of the machine state during program execution.
To check logs check the simulator.log file in the root directory, formed after running the tui.
| Component | Description |
|---|---|
| CPU Registers | Current values of A, X, L, PC, and SW registers |
| Disassembly | Assembly listing with PC indicator (>) |
| Object Code | Hexadecimal object code at each address |
| Symbol Table | Labels and their corresponding addresses |
| Memory Dump | Complete memory view in hexdump format |
| Key | Function |
|---|---|
q |
Exit simulator |
s |
Execute single instruction |
r |
Run until breakpoint or completion |
b |
Set breakpoint at current PC |
Tab |
Switch between Object Code and Symbol Table |
↑ ↓ |
Scroll through memory |
← → |
Navigate control buttons |
Enter |
Activate selected button |
- Pass 1: Symbol table generation, location counter management
- Pass 2: Object code generation, address resolution
H^PROGNAME^001000^000100 Header record
T^001000^1E^4B1000... Text record with object code
E^001000 End record
- Format 1: Single-byte instructions (e.g., FIX, FLOAT)
- Format 2: Two-byte register operations (e.g., CLEAR, COMPR)
- Format 3: Three-byte with 12-bit displacement
- Format 4: Four-byte extended with 20-bit address
Run the test suite:
cargo testTests are executed serially to avoid global state conflicts.
HexE/
├── src/
│ ├── assembler/ # Two-pass assembler implementation
│ ├── disassembler/ # Object code to assembly converter
│ ├── loader/ # Object program loader and linker
│ ├── simulator/ # Execution engine
│ ├── tui/ # Terminal UI components
│ └── predefined/ # Opcode tables and definitions
├── tests/ # Integration tests
└── reference_material/ # Documentation and screenshots
- Complete SIC/XE instruction set
- All addressing modes
- Symbol table generation
- Object code generation
- Memory visualization
- Literal pool support
- External references
- Control sections
- EQU support
- Operand Expression
- Program Blocks
- Debugger
- Relocation
- Linker
Built following the SIC/XE architecture specification from "System Software: An Introduction to Systems Programming" by Leland L. Beck.
