diff --git a/WEEK09/WEEK09-BN.md b/WEEK09/WEEK09-BN.md index 5dc12e0..0161e9d 100644 --- a/WEEK09/WEEK09-BN.md +++ b/WEEK09/WEEK09-BN.md @@ -1051,7 +1051,7 @@ The constant `s11` is loaded by the `vldr s11, [pc, #44]` at `0x1000040a`, which | 0.1f = 0x3dcccccd -> bytes cd cc cc 3d | | 5.0f = 0x40a00000 -> bytes 00 00 a0 40 | | | -| humidity = int + (decimal * 0.1f) becomes | +| humidity = int + (decimal * 0.1f) becomes | | humidity = int + (decimal * 5.0f) | | | +-----------------------------------------------------------------+ diff --git a/WEEK09/WEEK09-BN.pdf b/WEEK09/WEEK09-BN.pdf index 905c439..5ff4aba 100644 Binary files a/WEEK09/WEEK09-BN.pdf and b/WEEK09/WEEK09-BN.pdf differ diff --git a/WEEK09/WEEK09-IDA.md b/WEEK09/WEEK09-IDA.md index 41994f8..bce3dd1 100644 --- a/WEEK09/WEEK09-IDA.md +++ b/WEEK09/WEEK09-IDA.md @@ -630,7 +630,7 @@ The constant `s11` is loaded by the `vldr s11, [pc, #44]` at `0x1000040a`, which | 0.1f = 0x3dcccccd -> bytes cd cc cc 3d | | 5.0f = 0x40a00000 -> bytes 00 00 a0 40 | | | -| humidity = int + (decimal * 0.1f) becomes | +| humidity = int + (decimal * 0.1f) becomes | | humidity = int + (decimal * 5.0f) | | | +-----------------------------------------------------------------+ diff --git a/WEEK09/WEEK09-IDA.pdf b/WEEK09/WEEK09-IDA.pdf index 45ac9c8..10d204f 100644 Binary files a/WEEK09/WEEK09-IDA.pdf and b/WEEK09/WEEK09-IDA.pdf differ diff --git a/WEEK09/WEEK09.md b/WEEK09/WEEK09.md index 244071c..a3ac362 100644 --- a/WEEK09/WEEK09.md +++ b/WEEK09/WEEK09.md @@ -457,11 +457,11 @@ Let's trace through what happens to `x`: | ------------------+---------+--------------------------------- | | int x = 5; | 5 | x initialized to 5 | | x * y | 5 | arithmetic = 5 * 10 = 50 | -| x++ | 5->6 | increment = 5 (then x becomes 6)| +| x++ | 5->6 | increment = 5 (then x becomes 6) | | x > y | 6 | relational = (6 > 10) = false | | (x>y) && (y>x) | 6 | logical = false && true = false | | x << 1 | 6 | bitwise = 6 << 1 = 12 | -| x += 5 | 6->11 | assignment = 6 + 5 = 11 | +| x += 5 | 6->11 | assignment = 6 + 5 = 11 | | | +-----------------------------------------------------------------+ ``` diff --git a/WEEK09/WEEK09.pdf b/WEEK09/WEEK09.pdf index bc2d13a..205b448 100644 Binary files a/WEEK09/WEEK09.pdf and b/WEEK09/WEEK09.pdf differ diff --git a/WEEK11/WEEK11.md b/WEEK11/WEEK11.md index 4e42763..0ba1925 100644 --- a/WEEK11/WEEK11.md +++ b/WEEK11/WEEK11.md @@ -55,17 +55,17 @@ typedef struct { | Structure as a Container | | | | simple_led_ctrl_t leds | -| +-------------------------------------------------------------+| -| | led1_pin: 16 led2_pin: 17 led3_pin: 18 || -| | +--------+ +--------+ +--------+ || -| | | 16 | | 17 | | 18 | || -| | +--------+ +--------+ +--------+ || -| | || -| | led1_state: false led2_state: false led3_state: false || -| | +--------+ +--------+ +--------+ || -| | | false | | false | | false | || -| | +--------+ +--------+ +--------+ || -| +-------------------------------------------------------------+| +| +-------------------------------------------------------------+ | +| | led1_pin: 16 led2_pin: 17 led3_pin: 18 | | +| | +--------+ +--------+ +--------+ | | +| | | 16 | | 17 | | 18 | | | +| | +--------+ +--------+ +--------+ | | +| | | | +| | led1_state: false led2_state: false led3_state: false | | +| | +--------+ +--------+ +--------+ | | +| | | false | | false | | false | | | +| | +--------+ +--------+ +--------+ | | +| +-------------------------------------------------------------+ | | | | All 6 members live together as ONE variable called "leds" | | | @@ -277,19 +277,19 @@ int result = add_numbers(5, 3); // result = 8 | } | | | | Example: | -| +-------------------------------------------------------------+| -| | int ir_to_led_number ( int ir_command ) { || -| | --- --------------- --------------- || -| | | | | || -| | | | +-- Parameter (input) || -| | | +-- Function name || -| | +-- Return type (what it gives back) || -| | || -| | if (ir_command == 0x0C) return 1; <-- Body || -| | if (ir_command == 0x18) return 2; || -| | return 0; <-- Return value || -| | } || -| +-------------------------------------------------------------+| +| +-------------------------------------------------------------+ | +| | int ir_to_led_number ( int ir_command ) { | | +| | --- --------------- --------------- | | +| | | | | | | +| | | | +-- Parameter (input) | | +| | | +-- Function name | | +| | +-- Return type (what it gives back) | | +| | | | +| | if (ir_command == 0x0C) return 1; <-- Body | | +| | if (ir_command == 0x18) return 2; | | +| | return 0; <-- Return value | | +| | } | | +| +-------------------------------------------------------------+ | | | +-----------------------------------------------------------------+ ``` @@ -380,23 +380,23 @@ bl gpio_init ; call gpio_init(18) | Struct Flattening | | | | C Level (High-level abstraction): | -| +-------------------------------------------------------------+| -| | gpio_init(leds.led1_pin); || -| | gpio_init(leds.led2_pin); || -| | gpio_init(leds.led3_pin); || -| +-------------------------------------------------------------+| +| +-------------------------------------------------------------+ | +| | gpio_init(leds.led1_pin); | | +| | gpio_init(leds.led2_pin); | | +| | gpio_init(leds.led3_pin); | | +| +-------------------------------------------------------------+ | | | | | | Compiler transforms | | v | | Assembly Level (Flattened): | -| +-------------------------------------------------------------+| -| | movs r0, #16 ; Just the VALUE, no struct reference || -| | bl gpio_init || -| | movs r0, #17 ; Next value directly || -| | bl gpio_init || -| | movs r0, #18 ; Next value directly || -| | bl gpio_init || -| +-------------------------------------------------------------+| +| +-------------------------------------------------------------+ | +| | movs r0, #16 ; Just the VALUE, no struct reference | | +| | bl gpio_init | | +| | movs r0, #17 ; Next value directly | | +| | bl gpio_init | | +| | movs r0, #18 ; Next value directly | | +| | bl gpio_init | | +| +-------------------------------------------------------------+ | | | | The struct abstraction DISAPPEARS at the assembly level! | | We just see individual values being loaded and used. | diff --git a/WEEK11/WEEK11.pdf b/WEEK11/WEEK11.pdf index 0d65c11..cb82ce5 100644 Binary files a/WEEK11/WEEK11.pdf and b/WEEK11/WEEK11.pdf differ