OR-1 dataflow CPU sketch
1# dfasm Syntax Highlighting for Obsidian
2
3## Prerequisites
4
5- Obsidian v1.0+
6- [Shiki Highlighter](https://github.com/mProjectsCode/obsidian-shiki-plugin) plugin (v0.7.0+)
7
8## Setup
9
101. Install the Shiki Highlighter plugin from Obsidian's Community Plugins
112. Copy `dfasm.tmLanguage.json` from this directory into your vault
12 - Recommended location: `<vault>/.obsidian/shiki-languages/dfasm.tmLanguage.json`
13 - Any vault-relative path works
143. Open Shiki Highlighter plugin settings
154. Set the custom languages folder path to the directory containing the grammar
16 (e.g., `.obsidian/shiki-languages`)
175. Restart Obsidian
18
19## Usage
20
21Use `dfasm` as the language identifier in fenced code blocks:
22
23 ```dfasm
24 @system pe=2, sm=1
25 &c1|pe0 <| const, 3
26 &result|pe0 <| add
27 &c1|pe0 |> &result|pe0:L
28 ```
29
30## Updating
31
32When the grammar is updated (e.g., after re-running the conversion script),
33copy the new `dfasm.tmLanguage.json` to your vault and restart Obsidian.
34
35## Limitations
36
37The TextMate grammar cannot distinguish port numbers (`:5` in `&reader|pe0:5`)
38from literal numbers (`const, 5`) — both are highlighted as generic numbers.
39The Sublime Text grammar (in `editor/sublime/`) provides this distinction for
40editors that support context-stack grammars.