This commit is contained in:
parent
3dead55641
commit
b367e7f7f9
1
mu.md
1
mu.md
|
@ -197,6 +197,7 @@ var/reg <- increment
|
||||||
increment var
|
increment var
|
||||||
var/reg <- decrement
|
var/reg <- decrement
|
||||||
decrement var
|
decrement var
|
||||||
|
|
||||||
var1/reg1 <- add var2/reg2
|
var1/reg1 <- add var2/reg2
|
||||||
var/reg <- add var2
|
var/reg <- add var2
|
||||||
add-to var1, var2/reg
|
add-to var1, var2/reg
|
||||||
|
|
|
@ -192,3 +192,11 @@ command as often as you like:
|
||||||
```
|
```
|
||||||
./translate tutorial/task5.mu && qemu-system-i386 code.img
|
./translate tutorial/task5.mu && qemu-system-i386 code.img
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The section on [integer primitives](https://github.com/akkartik/mu/blob/main/mu.md#integer-primitives) shows that Mu consistently follows a few rules:
|
||||||
|
* Instructions that write to a register always have an output before the `<-`.
|
||||||
|
* Instructions that use an argument in memory always have it as the first
|
||||||
|
inout.
|
||||||
|
* Instructions that write to memory have a preposition in their name. Contrast
|
||||||
|
`add` to a register vs `add-to` a memory location, `subtract` from a
|
||||||
|
register vs `subtract-from` a memory location, and so on.
|
||||||
|
|
Loading…
Reference in New Issue