https://github.com/volemo/lass
Architecture agnostic assembler.
https://github.com/volemo/lass
agnostic assembler scheme
Last synced: 7 months ago
JSON representation
Architecture agnostic assembler.
- Host: GitHub
- URL: https://github.com/volemo/lass
- Owner: volemo
- License: mit
- Created: 2024-07-20T16:33:00.000Z (about 1 year ago)
- Default Branch: maester
- Last Pushed: 2024-09-22T12:24:12.000Z (about 1 year ago)
- Last Synced: 2025-01-21T20:27:51.547Z (9 months ago)
- Topics: agnostic, assembler, scheme
- Language: Common Lisp
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
lass is a little system-agnostic assembler.
Some quirks:
- Labels and constants are local to a macro block.
- Lass uses Verilog-style numbers.
- By default every line is 16 bit aligned.
- Characters are wastefull i.e. each takes up 16 bits.* Syntax
#+INCLUDE: "./example.lass" src lass** BNF
#+begin_src bnf
code = (ws? statement? ws? comment? nl)*
statement = import
| label
| definition
| instruction
import = ">" ws? filename
label = (name | number) ws? ":"
definition = name ws? "=" ws? (name | number | arithmetic | macro)
macro = argument-list ws? block
argument-list = "(" ws? argument? (ws argument)* ws? ")"
argument = (width "'")? name
block = "{" ws? nl? code nl? ws? "}"
instruction = (name | number | arithmetic | string)+
arithmetic = (width "'")?
"[" name (ws (name | number | arithmetic))* "]"
name = /[@$+_\-*&^%|a-zA-Z]+[@$+_\-*&^%|0-9a-zA-Z]*/
number = simple-number
| hexadecimal-number
| decimal-number
| binary-number
simple-number = /-?[0-9_]+/
hexadecimal-number = width? "'h" /[0-9a-fA-F_]+/
decimal-number = width? "'d" /[0-9_]+/
binary-number = width? "'b" /[01_]+/
width = /[0-9]+/
string = /"(\\.|[^\\\n])+"/
comment = /;.*/
filename = /[^<>:;,?"*|\/]+/
ws = /\s*/
#+end_src