https://github.com/erwijet/tibrs
A crate for compiling 8xp binaries from TI-BASIC source
https://github.com/erwijet/tibrs
8xp rust ti-basic
Last synced: 12 months ago
JSON representation
A crate for compiling 8xp binaries from TI-BASIC source
- Host: GitHub
- URL: https://github.com/erwijet/tibrs
- Owner: erwijet
- Created: 2024-01-08T05:55:52.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-17T18:22:56.000Z (almost 2 years ago)
- Last Synced: 2024-12-31T14:56:13.272Z (about 1 year ago)
- Topics: 8xp, rust, ti-basic
- Language: Rust
- Homepage: https://docs.rs/tibrs
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tibrs
A library and CLI for compimling and decompiling TI-BASIC to and from an `8xp` outside of TI-CONNECT.
## Installation
```sh
# add this crate to your project
$ cargo add tibrs
# install `tibc` binary
$ cargo install tibrs --bins
$ tibc --help # confirm installation
```
## Crate Usage
```rust
fn main() -> {
let source = fs::read_to_string("~/path/to/source.tib").unwrap();
let tokens: Vec = tibrs::parse_str(source).unwrap();
let buf: Vec = compile(tokens, "DEMONAME".as_bytes()).unwrap();
fs::write("~/path/to/DEMONAME.8xp", buf).unwrap();
}
```
## CLI Usage
Note: when compiling `8xp` files, `tibc` will infer the embedded `PRGM` var name from the first 8 letters of the outfile name, capitilized.
```sh
$ cargo install tibrs --bin tibc
# compile
$ tibc --compile --outfile DEMONAME.8xp source.tib
# decompile
$ tibc --decompile --outfile decomp.tib DEMONAME.8xp
```
## References
This binary implementation was based off the highly useful [Merthsoft TI Linkguide](https://merthsoft.com/linkguide/ti83+/fformat.html).