Skip to content

Commit b1f13ae

Browse files
committed
Better docs and tests
1 parent 79c76b6 commit b1f13ae

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

README.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
# Fateful
22
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/commonkestrel/fateful/rust.yml)
33

4-
Fateful is a CLI tool for working with my custom CPU, F8ful.
5-
Very much a work in progress.
4+
Fateful is a CLI tool foring with my custom CPU, F8ful.
5+
It contains an emulator and an assembler.
6+
Fateful can be installed through [cargo](https://github.com/rust-lang/cargo) via `cargo install --git https://github.com/commonkestrel/fateful`.
67

7-
# Peripherals
8+
## Assembler
89

10+
The assembler can be used with the `fateful asm` or `fateful assemble` command to assembler f8ful assembly into f8ful machine code.
11+
The input and output are both optional, and default to `stdin` and `stdout` respectively.
12+
13+
### Instructions
14+
15+
There are sixteen instructions in f8ful assembly.
16+
17+
## Emulator
18+
19+
## Tests
20+
21+
## Peripherals
922
Peripherals are a way to extend the emulator,
1023
simulating a memory-mapped peripheral.
1124
This is through the use of dynamic library loading,

examples/fib.asm

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
/// calculates the 8th fibonacci number and leaves the result in register D
2+
///
3+
/// a: 0x0D
4+
/// b: 0x15
5+
/// c: 0x00
6+
/// d: 0x15
27

38
@org 0x0000
49
@define COUNT 7

src/assembler/macros.asm

+4
Original file line numberDiff line numberDiff line change
@@ -320,3 +320,7 @@
320320
}
321321

322322
@macro use(%label:ident|label) {}
323+
324+
@macro shl (%r:reg) {
325+
add %r, %r
326+
}

0 commit comments

Comments
 (0)