From 189bd674a05316f0164d3eca86a048e24b662b99 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 26 Oct 2021 21:54:01 -0700 Subject: a few surprisingly nuanced tweaks to task 8 Thanks sejo for the feedback. --- tutorial/index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tutorial') diff --git a/tutorial/index.md b/tutorial/index.md index 68dd29aa..cea31945 100644 --- a/tutorial/index.md +++ b/tutorial/index.md @@ -287,20 +287,20 @@ Run `translate` (or `translate_emulated`) as usual. Use your runbook from Task All our variables so far have had type `int` (integer), but there are limits to what you can do with just whole integers. For example, here's the formula -a visitor to the US will require to convert a distance on a road sign to -kilometers: +a visitor to the US will require to convert distances mentioned on road signs +from miles to kilometers: ``` distance * 1.609 ``` Write a function to perform this conversion. Some starting points: -- reread [the section on variables and registers](https://github.com/akkartik/mu/blob/main/mu.md#variables-registers-and-memory) +* Reread [the section on variables and registers](https://github.com/akkartik/mu/blob/main/mu.md#variables-registers-and-memory) with special attention to the `float` type. -- 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 - fractional arguments. So you'll need to _create_ 1.609 somehow. Relevant is - [the section on moving values around](https://github.com/akkartik/mu/blob/main/mu.md#moving-values-around). +* 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 + 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). 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. -- cgit 1.4.1-2-gfad0