This commit is contained in:
Kartik K. Agaram 2021-10-26 22:02:23 -07:00
parent 189bd674a0
commit c055c4781f
2 changed files with 7 additions and 8 deletions

5
mu.md
View File

@ -436,7 +436,7 @@ Shifting bits right inserts zeros on the left by default.
A _signed_ shift right duplicates the leftmost bit, thereby preserving the A _signed_ shift right duplicates the leftmost bit, thereby preserving the
sign of an integer. sign of an integer.
## More complex instructions on more complex types ## Operations on more complex types
These instructions work with any type `T`. As before we use `/reg` here to These instructions work with any type `T`. As before we use `/reg` here to
indicate when a variable must live in a register. We also include type indicate when a variable must live in a register. We also include type
@ -605,7 +605,7 @@ type point {
} }
``` ```
Mu programs are currently sequences of `fn` and `type` definitions. Mu programs are sequences of just `fn` and `type` definitions.
Compound types can't include `addr` types for safety reasons (use `handle` instead, Compound types can't include `addr` types for safety reasons (use `handle` instead,
which is described below). They also can't currently include `array`, `stream` which is described below). They also can't currently include `array`, `stream`
@ -643,4 +643,3 @@ You can shallow-copy compound types using the `copy-object` function:
``` ```
copy-object src: (addr T), dest: (addr T) copy-object src: (addr T), dest: (addr T)
``` ```

View File

@ -300,11 +300,11 @@ Write a function to perform this conversion. Some starting points:
* Read [the section on floating-point arithmetic](https://github.com/akkartik/mu/blob/main/mu.md#floating-point-arithmetic). * Read [the section on floating-point arithmetic](https://github.com/akkartik/mu/blob/main/mu.md#floating-point-arithmetic).
* One wrinkle is that the x86 instruction set doesn't permit literal * One wrinkle is that the x86 instruction set doesn't permit literal
fractional arguments. So you'll need to _create_ 1.609 somehow. See the fractional arguments. So you'll need to _create_ 1.609 somehow. See the
sub-section on moving values around under [operations on simple types](https://github.com/akkartik/mu/blob/main/mu.md#operations-on-simple-types). section on moving values around under [operations on simple types](https://github.com/akkartik/mu/blob/main/mu.md#operations-on-simple-types).
This task has four source files in the repo that reveal more and more of the This task has four source files in the repo that reveal more and more of the
answer. Start from the first, and bump down if you need a hint. answer. Start from the first, and bump down if you need a hint.
- tutorial/task8.mu * tutorial/task8.mu
- tutorial/task8-hint1.mu * tutorial/task8-hint1.mu
- tutorial/task8-hint2.mu * tutorial/task8-hint2.mu
- tutorial/task8-hint3.mu * tutorial/task8-hint3.mu