A toy MSP430 assembler using recursive descent parsing for fast and efficient operation
Go to file
John dbc5a5fb69 Merge pull request 'v0.3.0' (#1) from v0.3.0 into main
Major rewrite to support new features. Should behave identically to v0.2.0 for any previously compatible source files, except the `.byte` and `.bytes` aliases for `.word` and `.words` have been removed, as has `.strings`

Reviewed-on: #1
2024-02-01 20:11:01 +00:00
examples/msp430-help v0.3.0: Total overhaul 2024-01-30 05:27:12 -06:00
msp430-asm Update copyright header 2024-02-01 12:37:59 -06:00
sample-asm Add one of my old Microcorruption solutions as an example 2024-01-30 05:40:49 -06:00
src Update copyright header 2024-02-01 12:37:59 -06:00
.gitignore Update .gitignore: Ignore vscode workspace config files 2024-01-26 18:27:23 -06:00
.rustfmt.toml v0.3.0: Total overhaul 2024-01-30 05:27:12 -06:00
Cargo.toml v0.3.0: Total overhaul 2024-01-30 05:27:12 -06:00
grammar.ebnf grammar.ebnf: Commit incomplete grammar description 2024-01-30 05:29:25 -06:00
LICENSE.md v0.3.0: Total overhaul 2024-01-30 05:27:12 -06:00
readme.md Add readme.md 2023-08-20 00:53:35 -05:00

msp430-asm

A toy assembler for the TI MSP430, built with MicroCorruption in mind.

Usage

msp430-asm [-|-f|--file]

The frontend isn't very smart. It does no fancy arg parsing, no key interpretation or cursor manipulation or TUI goodness that everyone knows and loves. It does four things: Read. Evaluate. Print. Loop. Basic REPL. It doesn't even check whether you're running interactively or not.

By default, the assembler operates in repl mode, and each line is treated in isolation. This is great for quickly looking up an instruction.

To parse an entire file at once, and get useful context when there's a parse error, pipe it in through stdin with - as such:

cat valid.asm | msp430-asm -f

You can press Ctrl+D on Linux to emit an EOF over the terminal.

Motivations

  • Microcorruption's assembler sucks
  • I got tired of stringly-typed Python
  • I wanted to write a parser
  • I wanted to write Rust
  • I'm a fan of interactive programs