Skip to content

Commit

Permalink
bring overhaul to master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
hlorenzi committed Aug 6, 2017
2 parents 6988382 + 444d86b commit 5b1e20f
Show file tree
Hide file tree
Showing 58 changed files with 5,781 additions and 4,704 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/target/
/temp/
/Cargo.lock
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "customasm"
version = "0.3.0"
version = "0.4.0"
authors = ["Henrique Lorenzi <[email protected]>"]

[lib]
Expand All @@ -12,4 +12,5 @@ name = "customasm"
path = "src/main.rs"

[dependencies]
getopts = "0.2.14"
getopts = "0.2.14"
num = "0.1.40"
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
# customasm
This is an assembler that takes custom instruction set definitions,
and assembles files based on that.
This is an assembler that takes custom instruction set definitions
and uses them to assemble source files.
This can be useful if you'd like to test out a new virtual machine's bytecode,
or even if you're eager to write programs for that new processor architecture
you just implemented in FPGA!
you just implemented in FPGA!

Check out the Releases section for pre-built binaries.

Check out the documentation for usage instructions:
- [Definition File Format](/doc/def.md)
- [Instruction Set File Format](/doc/instrset.md)
- [Source File Format](/doc/src.md)

```
Usage: customasm [options] <def-file> <asm-file> [<out-file>]
Usage: customasm [options] <instrset-file> <asm-file>
Options:
-h, --help Display this information.
-v, --version Display version information.
-q, --quiet Suppress progress reports.
-f, --format FORMAT The format of the output file. Possible formats:
binary, binstr, hexstr, bindump, hexdump
-o, --out-data FILE The name of the output file. (Default: a.out)
--stdout Write output to stdout instead of a file.
```

The idea is that, given this definition file:
The idea is that, given the following Instruction Set file:

```
#align 8
load r1, {value: _ <= 0xff} -> 8'0x11 value[7:0]
load r2, {value: _ <= 0xff} -> 8'0x12 value[7:0]
load r3, {value: _ <= 0xff} -> 8'0x13 value[7:0]
add r1, r2 -> 8'0x21
sub r3, {value: _ <= 0xff} -> 8'0x33 value[7:0]
jnz {address: _ <= 0xffff} -> 8'0x40 address[15:0]
ret -> 8'0x50
load r1, {value} -> 8'0x11 @ value[7:0]
load r2, {value} -> 8'0x12 @ value[7:0]
load r3, {value} -> 8'0x13 @ value[7:0]
add r1, r2 -> 8'0x21
sub r3, {value} -> 8'0x33 @ value[7:0]
jnz {address} -> 8'0x40 @ address[15:0]
ret -> 8'0x50
```

...the assembler would take this file:
...the assembler would take the following Source file:

```
#address 0x8000
#addr 0x8000
multiply3x4:
load r1, 0
Expand Down
163 changes: 0 additions & 163 deletions doc/def.md

This file was deleted.

Loading

0 comments on commit 5b1e20f

Please sign in to comment.