');
diff --git a/doc/index.md b/doc/index.md
new file mode 100644
index 0000000000..c5abcdc9cc
--- /dev/null
+++ b/doc/index.md
@@ -0,0 +1,26 @@
+% Dynasm-rs
+
+In the search for faster interpreters, Just-In-Time compilation is often a useful tool.
+This compiler extension attempts to make the writing of such programs easier and faster.
+
+At its core, dynasm-rs is an assembler compiler. It reads assembly templates which it then
+compiles into code that when executed will result in the proper machine code being emitted.
+
+Dynasm is split up into two parts. The first is the compiler extension that performs the
+translation of assembly templates into rust code, the second part is a
+[small runtime](../runtime/dynasmrt/index.html) that handles the generation of the wanted
+machine code.
+
+For now dynasm-rs only supports the x64 instruction set.
+
+Dynasm-rs is inspired by the LuaJIT DynASM project for C and C++.
+
+# Documentation
+
+The documentation of dynasm-rs is split up into several parts. To get started, you're advised
+to read through the [tutorial](./tutorial.html). After this, you can read through the
+[language reference](./langref.html) to learn about the syntax used by dynasm-rs. You can
+also read through the [runtime documentation](../runtime/dynasmrt/index.html) to learn about the
+runtime API. The [instruction reference](./instructionref.html) lists all assembly mnemnonics
+and formats supported by dynasm-rs. Finally, documentation on the
+[internals on dynasm-rs](../plugin/dynasm/index.html) can be referenced.
diff --git a/doc/instructionref.md b/doc/instructionref.md
new file mode 100644
index 0000000000..6cb9a28d93
--- /dev/null
+++ b/doc/instructionref.md
@@ -0,0 +1,3 @@
+% Instruction Reference
+
+Coming soon.
\ No newline at end of file
diff --git a/doc/langref.md b/doc/langref.md
new file mode 100644
index 0000000000..57fcb8137f
--- /dev/null
+++ b/doc/langref.md
@@ -0,0 +1,181 @@
+% Language Reference
+
+# Lexical structure definition
+
+## Base units
+
+The following syntax units used in dynasm syntax are defined by the [rust grammar](https://doc.rust-lang.org/grammar.html) itself:
+
+- `num_lit`
+- `ident`
+- `expr_path`
+- `expr`
+
+Dynasm-rs defines the following base syntax units:
+
+- `prefix : "cs" | "ds" | "es" | "fs" | "gs" | "ss" | "lock" | "rep" | "repne" | "repe" | "repnz" | "repz" ;`
+- `static_reg` matches any valid register name as seen in table 3
+- `dynamic_reg_family` matches any valid register family from table 3
+- `size : "BYTE" | "WORD" | "DWORD" | "AWORD" | "QWORD" | "OWORD" | "HWORD"`
+
+## Entry point
+
+The entry point of dynasm-rs is the dynasm! macro. It is structured as following
+
+`dynasm : "dynasm" "!" "(" ident (";" line)* ")" ;`
+
+Where line can be one of the following:
+
+`line : directive | label | instruction ;`
+
+## Directives
+
+Directives are special commands given to the assembler that do not correspond to instructions directly.
+
+`directive : "." ident (arg ("," arg)* )? ;`
+
+## Labels
+
+`label : ident ":" | "->" ident ":" | "=>" expr ;`
+
+## Instructions
+
+`instruction : prefix* ident (arg ("," arg)* )? ;`
+
+## Arguments
+
+`arg : register | (size? ( memoryref | labelref | typemap | expr ));`
+
+`memoryref : "[" (regref | labelref) "]" ;`
+
+`regref : regrefitem ("+" regrefitem)* ;`
+
+`regrefitem : (register "*" num_lit | num_lit "*" register | register | expr) ;`
+
+`labelref : (">" ident | "<" ident | "->" ident | "=>" expr) ;`
+
+`typemap : register "=>" expr_path ("." ident | "[" register "]" ("." ident)?) ;`
+
+`register = static_reg | dynamic_reg ;`
+
+`dynamic_reg = dynamic_reg_family "(" expr ")" ;`
+
+# Reference
+
+## Directives
+
+Dynasm-rs currently supports the following directives:
+
+
+Table 1: dynasm-rs directives
+
+Name | Argument format | Description
+----------|-----------------|------------
+`.align` | An expression of type usize | Pushes NOPs until the assembling head has reached the desired alignment.
+`.byte` | One or more expressions of the type `i8` | Pushes the values into the assembling buffer.
+`.word` | One or more expressions of the type `i16` | Pushes the values into the assembling buffer.
+`.dword` | One or more expressions of the type `i32` | Pushes the values into the assembling buffer.
+`.qword` | One or more expressions of the type `i64` | Pushes the values into the assembling buffer.
+`.bytes` | An expression of that implements `IntoIterator` or `IntoIterator` | extends the assembling buffer with the iterator.
+
+## Labels
+
+In order to describe flow control effectively, dynasm-rs supports labels. However, since the assembly templates can be combined in a variety of ways at the mercy of the program using dynasm-rs, the semantics of these labels are somewhat different from how labels work in a static assembler.
+
+Dynasm-rs distinguishes between three different types of labels: global, local and dynamic labels. Their syntax is as follows:
+
+Table 2: dynasm-rs label types
+
+Type | Definition | Reference
+--------|--------------|-----------
+Local | `label:` | `>label` or `