OR-1 dataflow CPU sketch
README.md

dfasm Syntax Highlighting for Obsidian#

Prerequisites#

Setup#

  1. Install the Shiki Highlighter plugin from Obsidian's Community Plugins
  2. Copy dfasm.tmLanguage.json from this directory into your vault
    • Recommended location: <vault>/.obsidian/shiki-languages/dfasm.tmLanguage.json
    • Any vault-relative path works
  3. Open Shiki Highlighter plugin settings
  4. Set the custom languages folder path to the directory containing the grammar (e.g., .obsidian/shiki-languages)
  5. Restart Obsidian

Usage#

Use dfasm as the language identifier in fenced code blocks:

```dfasm
@system pe=2, sm=1
&c1|pe0 <| const, 3
&result|pe0 <| add
&c1|pe0 |> &result|pe0:L
```

Updating#

When the grammar is updated (e.g., after re-running the conversion script), copy the new dfasm.tmLanguage.json to your vault and restart Obsidian.

Limitations#

The TextMate grammar cannot distinguish port numbers (:5 in &reader|pe0:5) from literal numbers (const, 5) — both are highlighted as generic numbers. The Sublime Text grammar (in editor/sublime/) provides this distinction for editors that support context-stack grammars.