Bitwise 2 / ISAs (start)
1
Bitwise 2 / ISAs (start) 1 Changelog Changes made in this version - - PowerPoint PPT Presentation
Bitwise 2 / ISAs (start) 1 Changelog Changes made in this version not seen in fjrst lecture: 4 Feb 2019: exercise (near end): replace abcdef with uvwxyz in exercise + explanation to make it more obviously not hexadecimal 1 last time C nits:
1
1
2
short sentinel = -9999; short *x; x = malloc(sizeof(short)*4); x[3] = sentinel; ...
x[0] x[1] x[2] x[3]
typedef struct range_t { unsigned int length; short *ptr; } range; range x; x.length = 3; x.ptr = malloc(sizeof(short)*3); ...
x.ptr[0] x.ptr[1] x.ptr[2]
typedef struct node_t { short payload; struct node_t *next; } node; node *x; x = malloc(sizeof(node_t)); ...
*x
3
short sentinel = -9999; short *x; x = malloc(sizeof(short)*4); x[3] = sentinel; ...
x[0] x[1] x[2] x[3]
typedef struct range_t { unsigned int length; short *ptr; } range; range x; x.length = 3; x.ptr = malloc(sizeof(short)*3); ...
x.ptr[0] x.ptr[1] x.ptr[2]
typedef struct node_t { short payload; struct node_t *next; } node; node *x; x = malloc(sizeof(node_t)); ...
*x
3
4
✭✭✭✭✭✭✭✭✭✭✭✭ ❤❤❤❤❤❤❤❤❤❤❤❤
✭✭✭✭✭✭✭✭✭✭✭✭ ❤❤❤❤❤❤❤❤❤❤❤❤
5
✭✭✭✭✭✭✭✭✭✭✭✭ ❤❤❤❤❤❤❤❤❤❤❤❤
✭✭✭✭✭✭✭✭✭✭✭✭ ❤❤❤❤❤❤❤❤❤❤❤❤
5
6
6
7
7
8
8
9
10
11
11
11
11
12
12
12
13
14
15
16
17
18
19
20
20
20
21
22
23
23
24
24
25
25
26
27
27
28
28
29
✓ ❙ ❙
✁ ❆ ❆
❍❍
30
✓ ❙ ❙
✁ ❆ ❆
❍❍
30
31
✭✭✭✭✭✭✭✭✭✭✭✭✭ ✭ ❤❤❤❤❤❤❤❤❤❤❤❤❤ ❤
32
✭✭✭✭✭✭✭✭✭✭✭✭✭ ✭ ❤❤❤❤❤❤❤❤❤❤❤❤❤ ❤
32
✭✭✭✭✭✭✭✭✭✭✭✭✭ ✭ ❤❤❤❤❤❤❤❤❤❤❤❤❤ ❤
32
33
33
34
34
34
35
35
36
36
37
37
37
38
39
39
39
(0|0|0|x7) (0|x7|x6|x5) (x6|x5|x4|x3) (x4|x3|x2|x1) (0|0|x7|x6) (x7|x6|x5|x4) (x5|x4|x3|x2) (x3|x2|x1|x0)
40
41
42
43
44
45
46
47
48
49
50
51
52
53