Skip to content

Commit

Permalink
Implement lexing and some parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinesfilmroellchen committed Apr 14, 2022
1 parent 6142081 commit ba7e612
Show file tree
Hide file tree
Showing 10 changed files with 1,236 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.spcasm linguist-language=Assembly
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk


# Added by cargo

/target
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "spcasm"
version = "0.1.0"
edition = "2021"
license = "BSD 2-clause"

[dependencies]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ spcasm assembles a binary memory dump of the SPC700's main memory. No entry poin
## Installation

This is a normal Rust project without special dependencies. Use `cargo` for building, running, testing etc.

## Usage

spcasm follows the mnemonic conventions from [this APU manual](https://web.archive.org/web/20060208001231/http://www.alpha-ii.com/snesmusic/files/spc700_apu_manual.txt). The directive and macro syntax is a subset of the [VASM oldstyle syntax](http://sun.hasenbraten.de/vasm/release/vasm_6.html#Oldstyle-Syntax-Module). If you're missing one of the features here, it would definitely be appreciated here!
18 changes: 18 additions & 0 deletions examples/test.spcasm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
MOV A,#$10
MOV A,(X)
MOV A,(X)+
MOV A,$32
MOV A,$A1+X
MOV A,$4502
MOV A,$3320+X
MOV A,$FF00+Y
MOV A,($40+X)
MOV A,($20)+Y
MOV X,#$60
MOV X,$9A
MOV X,$2E+Y
MOV X,$2F
MOV Y,#$0F
MOV Y,$48
MOV Y,$01+X
MOV Y,$21
Loading

0 comments on commit ba7e612

Please sign in to comment.