You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+22-2
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,31 @@
1
1
# Mindustry Assembler
2
-
The assembler doesn't do much other that make the jump commands dynamically calculated. It is meant for use with the [Mindustry Compiler]().
2
+
The assembler doesn't do much other that make the jump commands dynamically calculated. It is meant for use with the [Mindustry Compiler](TBD).
3
3
4
4
## Usage
5
+
Almost like normal Mindustry code, but with a few differences:
6
+
1. All code points must have whitespace in front of them after the newline
7
+
```mindustry
8
+
# Comments are fine
9
+
jump 21 always x false # They can be at the end of a line
10
+
op add x x 1
11
+
```
12
+
2. There are labels. They start with an &. They are used to calculate the location of a line. They do not need to be followed by an instruction, but they can be.
13
+
```mindustry
14
+
set i 0
15
+
# &loop will be computed correctly even when there are comments
16
+
&loop print "Hello, World!" # Here's a comment that doesn't matter
17
+
# Oh look, another comment
18
+
printflush message1
19
+
op add i i 1
20
+
jump &loop lessThan i 10
21
+
```
22
+
`&loop` will be computed and replaced in the jump command with the line number of the `&loop` label (1).
0 commit comments