Overview
The ttk91 crate provides a library for dealing with TTK91 bytecode and symbolic assembly files,
compiling assembly to bytecode and executing bytecode. The crate also includes tools
for doing these tasks from the command-line. The ttk91-wasm crate provides a (limited) WebAssembly interface for this crate, via which ttk91-web uses this crate.
Features
- Parse files containing TTK91 bytecode and assembly
- Compile symbolic assembly into bytecode
- Generate source map for the bytecode
- Execute bytecode
- Extensible IO and Memory interfaces
- Command-line utilities
Example
use ;
Command-line utilities
ttk91repl
The ttk91repl provides a Read-Execute-Print-Loop environment for the TTK91 symbolic assembly
language. It supports alternating between writing and executing code and provides multiple
commands suitable for debugging both TTK91 programs and the emulator itself.
0x8000> LOAD R1, =5
0x8001> OUT R1, =CRT
5
0x0002> .register r1
Register R1 = 5
0x8002> SUB R1, =1
0x8003> JNZER R1, 0x8001
4
3
2
1
0x8004>
ttk91run
Runs TTK91 programs with input and output piped to standard streams. If the supplied file contains assembly, compiles it to bytecode before executing it.
$ ttk91run tests/hello.b91
28